|
1 | 1 | """ |
2 | 2 | This is an object-orient plotting library. |
3 | 3 |
|
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:: |
6 | 6 |
|
7 | 7 | from pylab import * |
8 | 8 |
|
9 | | -or using ipython: |
| 9 | +or using ipython:: |
10 | 10 |
|
11 | 11 | ipython -pylab |
12 | 12 |
|
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. |
18 | 19 |
|
19 | 20 | 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 |
36 | 61 | 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 |
41 | 70 |
|
42 | 71 | 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. |
55 | 89 | """ |
56 | 90 | from __future__ import generators |
57 | 91 |
|
@@ -773,10 +807,8 @@ def use(arg, warn=True): |
773 | 807 | rcParams['cairo.format'] = validate_cairo_format(be_parts[1]) |
774 | 808 |
|
775 | 809 | 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'] |
780 | 812 |
|
781 | 813 | def interactive(b): |
782 | 814 | """ |
|
0 commit comments