8000 Doc tidy up. · chdemars/matplotlib@42efd6f · GitHub
[go: up one dir, main page]

Skip to content

Commit 42efd6f

Browse files
committed
Doc tidy up.
1 parent 462c805 commit 42efd6f

File tree

15 files changed

+163
-132
lines changed

15 files changed

+163
-132
lines changed

doc/api/api_changes.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,28 @@ Changes in 1.2.x
8484
implements a non-affine transformation, then it should override the
8585
``transform_non_affine`` method, rather than the generic ``transform`` method.
8686
Previously transforms would define ``transform`` and then copy the
87-
method into ``transform_non_affine``:
87+
method into ``transform_non_affine``::
8888

8989
class MyTransform(mtrans.Transform):
9090
def transform(self, xy):
9191
...
9292
transform_non_affine = transform
93-
94-
This approach will no longer function correctly and should be changed to:
93+
94+
95+
This approach will no longer function correctly and should be changed to::
9596

9697
class MyTransform(mtrans.Transform):
9798
def transform_non_affine(self, xy):
9899
...
100+
99101

100102
* Artists no longer have ``x_isdata`` or ``y_isdata`` attributes; instead
101103
any artist's transform can be interrogated with
102104
``artist_instance.get_transform().contains_branch(ax.transData)``
103105

104106
* Lines added to an axes now take into account their transform when updating the
105107
data and view limits. This means transforms can now be used as a pre-transform.
106-
For instance:
108+
For instance::
107109

108110
>>> import matplotlib.pyplot as plt
109111
>>> import matplotlib.transforms as mtrans

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
2626
extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table',
2727
'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
28+
'sphinx.ext.doctest',
2829
'matplotlib.sphinxext.plot_directive', 'sphinx.ext.inheritance_diagram',
2930
'gen_gallery', 'gen_rst',
3031
'matplotlib.sphinxext.ipython_console_highlighting', 'github']

doc/make.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ def sfpdf():
130130
'push a copy to the sf site'
131131
os.system('cd build/latex; scp Matplotlib.pdf jdh2358,matplotlib@web.sf.net:/home/groups/m/ma/matplotlib/htdocs/')
132132

133-
def figs():
134-
os.system('cd users/figures/ && python make.py')
133+
def doctest():
134+
os.system('sphinx-build -b doctest -d build/doctrees . build/doctest')
135+
136+
def linkcheck():
137+
os.system('sphinx-build -b linkcheck -d build/doctrees . build/linkcheck')
135138

136139
def html():
137140
check_build()
@@ -215,14 +218,15 @@ def all():
215218

216219

217220
funcd = {
218-
'figs' : figs,
219221
'html' : html,
220222
'latex' : latex,
221223
'texinfo' : texinfo,
222224
'clean' : clean,
223225
'sf' : sf,
224226
'sfpdf' : sfpdf,
225227
'all' : all,
228+
'doctest' : doctest,
229+
'linkcheck': linkcheck,
226230
}
227231

228232

doc/mpl_toolkits/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
.. _toolkits-index:
22

3+
.. toctree::
4+
:hidden:
5+
6+
axes_grid/index.rst
7+
mplot3d/index.rst
8+
9+
310
########
411
Toolkits
512
########

doc/users/github_stats.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Pull Requests (123):
120120
* :ghpull:`1164`: doc: note contourf hatching in whats_new.rst
121121
* :ghpull:`1153`: PEP8 on artist
122122
* :ghpull:`1163`: tight_layout: fix regression for figures with non SubplotBase Axes
123-
* :ghpull:`1159`: FIX assert_raises cannot be called with ``with\\
123+
* :ghpull:`1159`: FIX assert_raises cannot be called with ``with``
124124
* :ghpull:`1160`: backend_pgf: clarifications and fixes in documentation
125125
* :ghpull:`1154`: six inclusion for dateutil on py3 doesn't work
126126
* :ghpull:`1149`: Add Phil Elson's percentage histogram example
@@ -268,7 +268,7 @@ Issues (226):
268268
* :ghissue:`1153`: PEP8 on artist
269269
* :ghissue:`1163`: tight_layout: fix regression for figures with non SubplotBase Axes
270270
* :ghissue:`1117`: ERROR: matplotlib.tests.test_axes.test_contour_colorbar.test fails on Python 3
271-
* :ghissue:`1159`: FIX assert_raises cannot be called with ``with\\
271+
* :ghissue:`1159`: FIX assert_raises cannot be called with ``with``
272272
* :ghissue:`206`: hist normed=True problem?
273273
* :ghissue:`1160`: backend_pgf: clarifications and fixes in documentation
274274
* :ghissue:`1154`: six inclusion for dateutil on py3 doesn't work

doc/users/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ User's Guide
3131
recipes.rst
3232
screenshots.rst
3333
whats_new.rst
34+
github_stats.rst
3435
license.rst
3536
credits.rst
3637

examples/pylab_examples/mri_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pylab import *
55
import matplotlib.cbook as cbook
66
# data are 256x256 16 bit integers
7-
dfile = cbook.get_sample_data('s1045.ima')
7+
dfile = cbook.get_sample_data('s1045.ima.gz')
88
im = np.fromstring(dfile.read(), np.uint16).astype(float)
99
im.shape = 256, 256
1010

examples/units/basic_units.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ def __get__(self, obj, objtype=None):
1717
return self.proxy_type(self.fn_name, obj)
1818

1919

20-
class TaggedValueMeta (type):
21-
def __init__(cls, name, bases, dict):
22-
for fn_name in cls._proxies.keys():
20+
class TaggedValueMeta(type):
21+
def __init__(self, name, bases):
22+
for fn_name in self._proxies.keys():
2323
try:
24-
dummy = getattr(cls, fn_name)
24+
dummy = getattr(self, fn_name)
2525
except AttributeError:
26-
setattr(cls, fn_name,
27-
ProxyDelegate(fn_name, cls._proxies[fn_name]))
26+
setattr(self, fn_name,
27+
ProxyDelegate(fn_name, self._proxies[fn_name]))
2828

2929

3030
class PassThroughProxy(object):
@@ -189,7 +189,7 @@ def get_unit(self):
189189
return self.unit
190190

191191

192-
TaggedValue = TaggedValueMeta('TaggedValue', (_TaggedValue, ), {})
192+
TaggedValue = TaggedValueMeta('TaggedValue', (_TaggedValue, ))
193193

194194

195195
class BasicUnit(object):

lib/matplotlib/axes.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,44 +4433,44 @@ def legend(self, *args, **kwargs):
44334433
44344434
Call signature::
44354435
4436-
legend(*args, **kwargs)
4436+
legend(*args, **kwargs)
44374437
44384438
Places legend at location *loc*. Labels are a sequence of
44394439
strings and *loc* can be a string or an integer specifying the
44404440
legend location.
44414441
44424442
To make a legend with existing lines::
44434443
4444-
legend()
4444+
legend()
44454445
44464446
:meth:`legend` by itself will try and build a legend using the label
44474447
property of the lines/patches/collections. You can set the label of
44484448
a line by doing::
44494449
4450-
plot(x, y, label='my data')
4450+
plot(x, y, label='my data')
44514451
44524452
or::
44534453
4454-
line.set_label('my data').
4454+
line.set_label('my data').
44554455
44564456
If label is set to '_nolegend_', the item will not be shown in
44574457
legend.
44584458
44594459
To automatically generate the legend from labels::
44604460
4461-
legend( ('label1', 'label2', 'label3') )
4461+
legend( ('label1', 'label2', 'label3') )
44624462
44634463
To make a legend for a list of lines and labels::
44644464
4465-
legend( (line1, line2, line3), ('label1', 'label2', 'label3') )
4465+
legend( (line1, line2, line3), ('label1', 'label2', 'label3') )
44664466
44674467
To make a legend at a given location, using a location argument::
44684468
4469-
legend( ('label1', 'label2', 'label3'), loc='upper left')
4469+
legend( ('label1', 'label2', 'label3'), loc='upper left')
44704470
44714471
or::
44724472
4473-
legend( (line1, line2, line3), ('label1', 'label2', 'label3'), loc=2)
4473+
legend( (line1, line2, line3), ('label1', 'label2', 'label3'), loc=2)
44744474
44754475
The location codes are
44764476
@@ -4496,7 +4496,7 @@ def legend(self, *args, **kwargs):
44964496
of BboxBase(or its derivatives) or a tuple of 2 or 4 floats.
44974497
For example,
44984498
4499-
loc = 'upper right', bbox_to_anchor = (0.5, 0.5)
4499+
loc = 'upper right', bbox_to_anchor = (0.5, 0.5)
45004500
45014501
will place the legend so that the upper right corner of the legend at
45024502
the center of the axes.
@@ -7072,6 +7072,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
70727072
**Example:**
70737073
70747074
.. plot:: mpl_examples/pylab_examples/image_demo.py
7075+
70757076
"""
70767077

70777078
if not self._hold: self.cla()

0 commit comments

Comments
 (0)
0