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

Skip to content

Commit 401e907

Browse files
committed
Tidied up some of the documentation.
1 parent 218b550 commit 401e907

19 files changed

+235
-217
lines changed

doc/_templates/index.html

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,8 @@
11
{% extends "layout.html" %}
22
{% set title = 'matplotlib: python plotting' %}
33

4-
54
{% block body %}
65

7-
<h1>John Hunter (1968-2012)</h1>
8-
9-
<table bgcolor="#ddddff">
10-
<tr>
11-
<td>
12-
<img src="_static/John-hunter-crop-2.jpg"/>
13-
</td>
14-
<td>
15-
<p>
16-
On August 28 2012, John D. Hunter, the creator of matplotlib, died
17-
from complications arising from cancer treatment, after a brief but
18-
intense battle with this terrible illness. John is survived by his
19-
wife Miriam, his three daughters Rahel, Ava and Clara, his sisters
20-
Layne and Mary, and his mother Sarah.</p>
21-
22-
<p>
23-
If you have benefited from John's many contributions, please say
24-
thanks in the way that would matter most to him. Please consider
25-
making a donation to
26-
the <a href="http://numfocus.org/johnhunter/">John Hunter Memorial
27-
Fund</a>.</p>
28-
</td>
29-
</tr>
30-
</table>
31-
326
<h1>Introduction</h1>
337

348
<p>matplotlib is a python 2D plotting library which produces
@@ -66,6 +40,32 @@ <h1>Introduction</h1>
6640
properties, axes properties, etc, via an object oriented interface
6741
or via a set of functions familiar to MATLAB users.</p>
6842

43+
<div style="float: right; min-width: 450px; width: 50%; padding-left: 5%;">
44+
<h1>John Hunter (1968-2012)</h1>
45+
<table bgcolor="#ddddff">
46+
<tr>
47+
<td>
48+
<img src="_static/John-hunter-crop-2.jpg" align="left" />
49+
</td>
50+
<td>
51+
<p>
52+
On August 28 2012, John D. Hunter, the creator of matplotlib, died
53+
from complications arising from cancer treatment, after a brief but
54+
intense battle with this terrible illness. John is survived by his
55+
wife Miriam, his three daughters Rahel, Ava and Clara, his sisters
56+
Layne and Mary, and his mother Sarah.</p>
57+
58+
<p>
59+
If you have benefited from John's many contributions, please say
60+
thanks in the way that would matter most to him. Please consider
61+
making a donation to
62+
the <a href="http://numfocus.org/johnhunter/">John Hunter Memorial
63+
Fund</a>.</p>
64+
</td>
65+
</tr>
66+
</table>
67+
</div>
68+
6969
<h1>Download</h1>
7070

7171
Visit the
@@ -143,30 +143,31 @@ <h1>Toolkits</h1>
143143
<h1>Citing matplotlib</h1>
144144

145145
<p>
146-
matplotlib is the brainchild of John Hunter (1968-2012), who has put an
147-
inordinate amount of effort into producing a piece of software utilized by
148-
thousands of scientists worldwide.
146+
matplotlib is the brainchild of John Hunter (1968-2012), who, along with its many
147+
contributors, have put an immeasurable amount of time and effort into producing a
148+
piece of software utilized by thousands of scientists worldwide.
149149

150150
If matplotlib contributes to a project that leads to a scientific publication,
151-
please acknowledge this fact by citing the project. You can use this
151+
please acknowledge this work by citing the project. You can use this
152152
<a href="{{ pathto('citing') }}">ready-made citation entry</a>.
153153
</p>
154154

155155
<h1>Open source</h1>
156156

157-
<p>Please
158-
consider <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donating</a>
159-
to support matplotlib development or to
160-
the <a href="http://numfocus.org/johnhunter/">John Hunter Memorial
161-
Fund</a>.</p>
157+
<p>
158+
Please consider <a href="http://sourceforge.net/project/project_donations.php?group_id=80706">donating</a>
159+
to support matplotlib development or to the <a href="http://numfocus.org/johnhunter/">John Hunter Memorial Fund</a>.
160+
</p>
162161

163-
<p>The matplotlib <a href="{{ pathto('users/license') }}">license</a>
164-
is based on the Python Software Foundation
165-
<a href="http://www.python.org/psf/license">(PSF)</a> license.</p>
162+
<p>
163+
The matplotlib <a href="{{ pathto('users/license') }}">license</a> is based on the Python Software Foundation
164+
<a href="http://www.python.org/psf/license">(PSF)</a> license.
165+
</p>
166166

167-
<p>There is an active developer community and a long list of people
168-
who have made significant <a href="{{ pathto('users/credits')
169-
}}">contributions</a>.</p>
167+
<p>
168+
There is an active developer community and a long list of people
169+
who have made significant <a href="{{ pathto('users/credits') }}">contributions</a>.
170+
</p>
170171

171172

172173
<div class="footnote"><p>
@@ -178,6 +179,4 @@ <h1>Open source</h1>
178179
Mathematica is a registered trademark of Wolfram Research, Inc.
179180
</p>
180181

181-
182-
183182
{% endblock %}

doc/_templates/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<li><a href="{{ pathto('search') }}">search</a>|&nbsp;</li>
3939
<li><a href="{{ pathto('examples/index') }}">examples</a>|&nbsp;</li>
4040
<li><a href="{{ pathto('gallery') }}">gallery</a>|&nbsp;</li>
41+
<li><a href="{{ pathto('api/pyplot_summary') }}">pyplot</a>|&nbsp;</li>
4142
<li><a href="{{ pathto('citing') }}">citation</a>|&nbsp;</li>
4243
<li><a href="{{ pathto('contents') }}">docs</a> &raquo;</li>
4344
{% endblock %}

doc/api/cm_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
cm (colormap)
33
*************
44

5-
65
:mod:`matplotlib.cm`
76
====================
87

doc/api/colors_api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
colors
33
******
44

5+
For a plot showing the available matplotlib colormaps see the
6+
:ref:`colormap <pylab_examples-show_colormaps>` example.
7+
58

69
:mod:`matplotlib.colors`
710
========================
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
*************
2-
configuration
3-
*************
4-
5-
6-
:mod:`matplotlib`
7-
=================
1+
The top level :mod:`matplotlib` module
2+
======================================
83

94
.. automodule:: matplotlib
105
:members: rc, rcdefaults, use
6+
:members:
117
:undoc-members:
128
:show-inheritance:
13-

doc/api/nxutils_api.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/mpl_toolkits/index.rst

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,31 @@ Toolkits are collections of application-specific functions that extend matplotli
2222

2323
.. _toolkit_basemap:
2424

25-
Basemap
26-
=======
25+
Basemap (*Not distributed with matplotlib*)
26+
============================================
2727

2828
Plots data on map projections, with continental and political
29-
boundaries, see `basemap <http://matplotlib.github.com/basemap>`_
29+
boundaries, see `basemap <http://matplotlib.org/basemap>`_
3030
docs.
3131

32+
.. image:: http://matplotlib.org/basemap/_images/contour1.png
33+
:height: 400px
34+
35+
36+
37+
Cartopy (*Not distributed with matplotlib*)
38+
============================================
39+
An alternative mapping library written for matplotlib ``v1.2`` and beyond.
40+
`Cartopy <http://scitools.org.uk/cartopy/docs/latest>`_ builds on top of
41+
matplotlib to provide object oriented map projection definitions and close
42+
integration with Shapely for powerful yet easy-to-use vector data processing
43+
tools. An example plot from the
44+
`Cartopy gallery <http://scitools.org.uk/cartopy/docs/latest/gallery.html>`_:
45+
46+
.. image:: http://scitools.org.uk/cartopy/docs/latest/_images/hurricane_katrina_01_00.png
47+
:height: 400px
48+
49+
3250
.. _toolkit_gtk:
3351

3452
GTK Tools
@@ -38,6 +56,7 @@ mpl_toolkits.gtktools provides some utilities for working with GTK.
3856
This toolkit ships with matplotlib, but requires `pygtk
3957
<http://www.pygtk.org/>`_.
4058

59+
4160
.. _toolkit_excel:
4261

4362
Excel Tools
@@ -47,38 +66,39 @@ mpl_toolkits.exceltools provides some utilities for working with
4766
Excel. This toolkit ships with matplotlib, but requires
4867
`xlwt <http://pypi.python.org/pypi/xlwt>`_
4968

69+
5070
.. _toolkit_natgrid:
5171

52-
Natgrid
53-
========
72+
Natgrid (*Not distributed with matplotlib*)
73+
===========================================
5474

5575
mpl_toolkits.natgrid is an interface to natgrid C library for gridding
5676
irregularly spaced data. This requires a separate installation of the
5777
natgrid toolkit from the sourceforge `download
5878
<http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792>`_
5979
page.
6080

81+
6182
.. _toolkit_mplot3d:
6283

6384
mplot3d
6485
===========
6586

66-
mpl_toolkits.mplot3d provides some basic 3D plotting (scatter, surf,
87+
:ref:`mpl_toolkits.mplot3d <toolkit_mplot3d-index>` provides some basic 3D plotting (scatter, surf,
6788
line, mesh) tools. Not the fastest or feature complete 3D library out
6889
there, but ships with matplotlib and thus may be a lighter weight
6990
solution for some use cases.
7091

71-
See :ref:`toolkit_mplot3d-index` for more documentation and examples.
92+
.. image:: /_images/contourf3d_demo21.png
93+
7294

7395
.. _toolkit_axes_grid:
7496

7597
AxesGrid
7698
========
7799

78-
The matplotlib AxesGrid toolkit is a collection of helper classes to
100+
The matplotlib :ref:`AxesGrid <toolkit_axesgrid-index>` toolkit is a collection of helper classes to
79101
ease displaying multiple images in matplotlib. The AxesGrid toolkit is
80102
distributed with matplotlib source.
81103

82-
.. image:: ../_static/demo_axes_grid.png
83-
84-
See :ref:`toolkit_axesgrid-index` for documentations.
104+
.. image:: /_static/demo_axes_grid.png

examples/pylab_examples/marker_path.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
star = mpath.Path.unit_regular_star(6)
77
circle = mpath.Path.unit_circle()
8-
# concatenate the star with an internal cutout of the circle
9-
verts = np.concatenate([star.vertices, circle.vertices[::-1, ...]])
10-
codes = np.concatenate([star.codes, circle.codes])
8+
# concatenate the circle with an internal cutout of the star
9+
verts = np.concatenate([circle.vertices, star.vertices[::-1, ...]])
10+
codes = np.concatenate([circle.codes, star.codes])
1111
cut_star = mpath.Path(verts, codes)
1212

1313

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,57 @@
1-
#!/usr/bin/env python
21
"""
3-
See pcolor_demo2 for an alternative way of generating pcolor plots
4-
using imshow that is likely faster for large grids
2+
Demonstrates similarities between pcolor, pcolormesh, imshow and pcolorfast
3+
for drawing quadrilateral grids.
4+
55
"""
6-
from __future__ import division
7-
from matplotlib.patches import Patch
8-
from pylab import *
6+
import matplotlib.pyplot as plt
7+
import numpy as np
98

10-
def func3(x,y):
11-
return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)
9+
# make these smaller to increase the resolution
10+
dx, dy = 0.15, 0.05
1211

12+
# generate 2 2d grids for the x & y bounds
13+
y, x = np.mgrid[slice(-3, 3 + dy, dy),
14+
slice(-3, 3 + dx, dx)]
15+
z = (1 - x / 2. + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2)
16+
# x and y are bounds, so z should be the value *inside* those bounds.
17+
# Therefore, remove the last value from the z array.
18+
z = z[:-1, :-1]
19+
z_min, z_max = -np.abs(z).max(), np.abs(z).max()
20+
21+
22+
23+
plt.subplot(2, 2, 1)
24+
plt.pcolor(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max)
25+
plt.title('pcolor')
26+
# set the limits of the plot to the limits of the data
27+
plt.axis([x.min(), x.max(), y.min(), y.max()])
28+
plt.colorbar()
29+
30+
31+
32+
plt.subplot(2, 2, 2)
33+
plt.pcolormesh(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max)
34+
plt.title('pcolormesh')
35+
# set the limits of the plot to the limits of the data
36+
plt.axis([x.min(), x.max(), y.min(), y.max()])
37+
plt.colorbar()
38+
39+
40+
41+
plt.subplot(2, 2, 3)
42+
plt.imshow(z, cmap='RdBu', vmin=z_min, vmax=z_max,
43+
extent=[x.min(), x.max(), y.min(), y.max()],
44+
interpolation='nearest', origin='lower')
45+
plt.title('image (interp. nearest)')
46+
plt.colorbar()
1347

14-
# make these smaller to increase the resolution
15-
dx, dy = 0.05, 0.05
1648

17-
x = arange(-3.0, 3.0001, dx)
18-
y = arange(-3.0, 3.0001, dy)
19-
X,Y = meshgrid(x, y)
2049

21-
Z = func3(X, Y)
22-
pcolor(X, Y, Z, cmap=cm.RdBu, vmax=abs(Z).max(), vmin=-abs(Z).max())
23-
colorbar()
24-
axis([-3,3,-3,3])
50+
ax = plt.subplot(2, 2, 4)
51+
ax.pcolorfast(x, y, z, cmap='RdBu', vmin=z_min, vmax=z_max)
52+
plt.title('pcolorfast')
53+
plt.colorbar()
2554

26-
show()
2755

2856

57+
plt.show()

examples/pylab_examples/pcolor_demo2.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)