Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f89c5e

Browse files
committed
convert docstrings to rest
svn path=/trunk/matplotlib/; revision=5532
1 parent 8b81106 commit 9f89c5e

2 files changed

Lines changed: 88 additions & 56 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 76 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,91 @@
11
"""
22
This is an object-orient plotting library.
33
4-
A procedural interface is provided by the companion pylab
5-
module, which may be imported directly, e.g.
4+
A procedural interface is provided by the companion pylab module,
5+
which may be imported directly, e.g::
66
77
from pylab import *
88
9-
or using ipython:
9+
or using ipython::
1010
1111
ipython -pylab
1212
13-
For the most part, direct use of the object-oriented library
14-
is encouraged when programming rather than working
15-
interactively. The exceptions are the pylab commands
16-
figure(), subplot(), show(), and savefig(), which can
17-
greatly simplify scripting.
13+
For the most part, direct use of the object-oriented library is
14+
encouraged when programming rather than working interactively. The
15+
exceptions are the pylab commands :func:`~matplotlib.pyplot.figure`,
16+
:func:`~matplotlib.pyplot.subplot`,
17+
:func:`~matplotlib.backends.backend_qt4agg.show`, and
18+
:func:`~pyplot.savefig`, which can greatly simplify scripting.
1819
1920
Modules include:
20-
axes: defines the Axes class. Most pylab commands are
21-
wrappers for Axes methods. The axes module is the
22-
highest level of OO access to the library.
23-
figure: defines Figure class.
24-
artist: defines the Artist base class for all classes
25-
that draw things.
26-
line: defines Line2D class for drawing lines and markers
27-
patches: defines classes for drawing polygons
28-
text: defines Text, TextWithDash, and Annotate classes
29-
image: defines AxesImage and FigureImage classes
30-
collections: classes for efficient drawing of groups of
31-
lines or polygons
32-
colors: classes for interpreting color specifications
33-
and for making colormaps
34-
cm: colormaps and the ScalarMappable mixin class for
35-
providing color mapping functionality to other
21+
22+
:mod:`matplotlib.axes`
23+
defines the :class:`~matplotlib.axes.Axes` class. Most pylab
24+
commands are wrappers for :class:`~matplotlib.axes.Axes`
25+
methods. The axes module is the highest level of OO access to
26+
the library.
27+
28+
:mod:`matplotlib.figure`
29+
defines the :class:`~matplotlib.figure.Figure` class.
30+
31+
:mod:`matplotlib.artist`
32+
defines the :class:`~matplotlib.artist.Artist` base class for
33+
all classes that draw things.
34+
35+
:mod:`matplotlib.lines`
36+
defines the :class:`~matplotlib.lines.Line2D` class for
37+
drawing lines and markers
38+
39+
:mod`matplotlib.patches`
40+
defines classes for drawing polygons
41+
42+
:mod:`matplotlib.text`
43+
defines the :class:`~matplotlib.text.Text`,
44+
:class:`~matplotlib.text.TextWithDash`, and
45+
:class:`~matplotlib.text.Annotate` classes
46+
47+
:mod:`matplotlib.image`
48+
defines the :class:`~matplotlib.image.AxesImage` and
49+
:class:`~matplotlib.image.FigureImage` classes
50+
51+
:mod:`matplotlib.collections`
52+
classes for efficient drawing of groups of lines or polygons
53+
54+
:mod:`matplotlib.colors`
55+
classes for interpreting color specifications and for making
56+
colormaps
57+
58+
:mod:`matplotlib.cm`
59+
colormaps and the :class:`~matplotlib.image.ScalarMappable`
60+
mixin class for providing color mapping functionality to other
3661
classes
37-
ticker: classes for calculating tick mark locations and
38-
for formatting tick labels
39-
backends: a subpackage with modules for various gui
40-
libraries and output formats
62+
63+
:mod:`matplotlib.ticker`
64+
classes for calculating tick mark locations and for formatting
65+
tick labels
66+
67+
:mod:`matplotlib.backends`
68+
a subpackage with modules for various gui libraries and output
69+
formats
4170
4271
The base matplotlib namespace includes:
43-
rcParams: a dictionary of default configuration
44-
settings. It is initialized by code which may be
45-
overridded by a matplotlibrc file.
46-
rc(): a function for setting groups of rcParams values
47-
use(): a function for setting the matplotlib backend.
48-
If used, this function must be called immediately
49-
after importing matplotlib for the first time. In
50-
particular, it must be called *before* importing
51-
pylab (if pylab is imported).
52-
53-
matplotlib is written by John D. Hunter (jdh2358 at
54-
gmail.com and a host of others).
72+
73+
:data:`~matplotlib.rcParams`
74+
a global dictionary of default configuration settings. It is
75+
initialized by code which may be overridded by a matplotlibrc
76+
file.
77+
78+
:func:`~matplotlib.rc`
79+
a function for setting groups of rcParams values
80+
81+
:func:`~matplotlib.use`
82+
a function for setting the matplotlib backend. If used, this
83+
function must be called immediately after importing matplotlib
84+
for the first time. In particular, it must be called
85+
**before** importing pylab (if pylab is imported).
86+
87+
matplotlib is written by John D. Hunter (jdh2358 at gmail.com) and a
88+
host of others.
5589
"""
5690
from __future__ import generators
5791

@@ -773,10 +807,8 @@ def use(arg, warn=True):
773807
rcParams['cairo.format'] = validate_cairo_format(be_parts[1])
774808

775809
def get_backend():
776-
# Validation is needed because the rcParams entry might have
777-
# been set directly rather than via "use()".
778-
return validate_backend(rcParams['backend'])
779-
#return rcParams['backend'].lower()
810+
"Returns the current backend"
811+
return rcParams['backend']
780812

781813
def interactive(b):
782814
"""

lib/matplotlib/backend_bases.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,34 +1474,34 @@ class NavigationToolbar2:
14741474
They must also define
14751475
14761476
:meth:`save_figure`
1477-
save the current figure
1477+
save the current figure
14781478
14791479
:meth:`set_cursor`
1480-
if you want the pointer icon to change
1480+
if you want the pointer icon to change
14811481
14821482
:meth:`_init_toolbar`
1483-
create your toolbar widget
1483+
create your toolbar widget
14841484
14851485
:meth:`draw_rubberband` (optional)
1486-
draw the zoom to rect "rubberband" rectangle
1486+
draw the zoom to rect "rubberband" rectangle
14871487
14881488
:meth:`press` (optional)
1489-
whenever a mouse button is pressed, you'll be
1490-
notified with the event
1489+
whenever a mouse button is pressed, you'll be notified with
1490+
the event
14911491
14921492
:meth:`release` (optional)
1493-
whenever a mouse button is released, you'll be notified with
1494-
the event
1493+
whenever a mouse button is released, you'll be notified with
1494+
the event
14951495
14961496
:meth:`dynamic_update` (optional)
1497-
dynamically update the window while navigating
1497+
dynamically update the window while navigating
14981498
14991499
:meth:`set_message` (optional)
1500-
display message
1500+
display message
15011501
15021502
:meth:`set_history_buttons` (optional)
1503-
you can change the history back / forward buttons to
1504-
indicate disabled / enabled state.
1503+
you can change the history back / forward buttons to
1504+
indicate disabled / enabled state.
15051505
15061506
That's it, we'll do the rest!
15071507
"""

0 commit comments

Comments
 (0)