Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a683e8f

Browse filesBrowse files
committed
Merge doc/api/api_overview and doc/api/index.
1 parent 959e9f3 commit a683e8f
Copy full SHA for a683e8f

File tree

Expand file treeCollapse file tree

3 files changed

+59
-67
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+59
-67
lines changed

‎doc/_templates/layout.html

Copy file name to clipboardExpand all lines: doc/_templates/layout.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>{{ _('Navigation') }}</h3>
4040
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
4141
<li><a href="{{ pathto('gallery/index') }}">examples</a>|&nbsp;</li>
4242
<li><a href="{{ pathto('tutorials/index') }}">tutorials</a>|&nbsp;</li>
43-
<li><a href="{{ pathto('api/api_overview') }}">API</a>|&nbsp;</li>
43+
<li><a href="{{ pathto('api/index') }}">API</a>|&nbsp;</li>
4444
<li><a href="{{ pathto('contents') }}">contents</a> &raquo;</li>
4545

4646
{%- for parent in parents %}

‎doc/api/api_overview.rst

Copy file name to clipboardExpand all lines: doc/api/api_overview.rst
-55Lines changed: 0 additions & 55 deletions
This file was deleted.

‎doc/api/index.rst

Copy file name to clipboardExpand all lines: doc/api/index.rst
+58-11Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,52 @@
1-
.. _api-index:
1+
API Overview
2+
============
23

3-
####################
4-
The Matplotlib API
5-
####################
4+
Below we describe several common approaches to plotting with Matplotlib. See
5+
also the :doc:`api_changes`.
66

77
.. toctree::
8-
:maxdepth: 1
8+
:hidden:
9+
10+
api_changes
11+
12+
.. contents:: :local:
13+
14+
The pyplot API
15+
--------------
16+
17+
`matplotlib.pyplot` is a collection of command style functions that make
18+
Matplotlib work like MATLAB. Each pyplot function makes some change to a
19+
figure: e.g., creates a figure, creates a plotting area in a figure, plots
20+
some lines in a plotting area, decorates the plot with labels, etc.
21+
22+
`.pyplot` is mainly intended for interactive plots and simple cases of
23+
programmatic plot generation.
24+
25+
Further reading:
26+
27+
- The `matplotlib.pyplot` function reference
28+
- :doc:`/tutorials/introductory/pyplot`
29+
- :ref:`Pyplot examples <pyplots_examples>`
930

10-
api_overview.rst
11-
api_changes.rst
31+
The object-oriented API
32+
-----------------------
1233

34+
At its core, Matplotlib is object-oriented. We recommend directly working
35+
with the objects, if you need more control and customization of your plots.
1336

14-
Modules
15-
=======
37+
In many cases you will create a `.Figure` and one or more
38+
`~matplotlib.axes.Axes` using `.pyplot.subplots` and from then on only work
39+
on these objects. However, it's also possible to create `.Figure`\ s
40+
explicitly (e.g. when including them in GUI applications).
41+
42+
Further reading:
43+
44+
- `matplotlib.axes.Axes` and `matplotlib.figure.Figure` for an overview of
45+
plotting functions.
46+
- Most of the :ref:`examples <examples-index>` use the object-oriented approach
47+
(except for the pyplot section)
48+
49+
All Matplotlib submodules are documented here:
1650

1751
.. toctree::
1852
:maxdepth: 1
@@ -73,8 +107,7 @@ Modules
73107
units_api.rst
74108
widgets_api.rst
75109

76-
Toolkits
77-
========
110+
... and the ``mpl_toolkits`` here:
78111

79112
.. toctree::
80113
:maxdepth: 1
@@ -84,3 +117,17 @@ Toolkits
84117
toolkits/axes_grid1.rst
85118
toolkits/axisartist.rst
86119
toolkits/axes_grid.rst
120+
121+
122+
The pylab API (disapproved)
123+
---------------------------
124+
125+
.. warning::
126+
Since heavily importing into the global namespace may result in unexpected
127+
behavior, the use of pylab is strongly discouraged. Use `matplotlib.pyplot`
128+
instead.
129+
130+
`matplotlib.pylab` is a module that includes `matplotlib.pyplot`, `numpy`
131+
and some additional functions within a single namespace. Its original purpose
132+
was to mimic a MATLAB-like way of working by importing all functions into the
133+
global namespace. This is considered bad style nowadays.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.