Skip to content

Commit be14152

Browse files
committed
fix a few more sphinx warnings
1 parent 7b24b2a commit be14152

File tree

7 files changed

+91
-91
lines changed

7 files changed

+91
-91
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ working with Sphinx in general. Here are a few additional things to keep in mind
176176
* The autodoc extension will handle index entries for the API, but additional
177177
entries in the index_ need to be explicitly added.
178178

179+
.. _Sphinx: http://sphinx.pocoo.org
179180
.. _documentation: http://sphinx.pocoo.org/contents.html
180181
.. _`inline markup`: http://sphinx.pocoo.org/markup/inline.html
181182
.. _index: http://sphinx.pocoo.org/markup/para.html#index-generating-markup

doc/faq/installing_faq.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ Compile matplotlib with PyGTK-2.4
277277
-------------------------------------------
278278

279279
There is a `bug in PyGTK-2.4`_. You need to edit
280-
:file:`pygobject.h` to add the :cmacro:`G_BEGIN_DECLS` and :cmacro:`G_END_DECLS`
281-
macros, and rename :cdata:`typename` parameter to :cdata:`typename_`::
280+
:file:`pygobject.h` to add the :c:macro:`G_BEGIN_DECLS` and
281+
:c:macro:`G_END_DECLS` macros, and rename :c:data:`typename` parameter to
282+
:c:data:`typename_`::
282283

283284
- const char *typename,
284285
+ const char *typename_,

doc/users/image_tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ object:
228228

229229
There are many other colormap schemes available. See the `list and images of the colormaps <http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html>`_.
230230

231-
.. _`Color Bars`
231+
.. _`Color Bars`:
232232

233233
Color scale reference
234234
------------------------
@@ -256,7 +256,7 @@ automatically change if you change you switch to a different
256256
colormap - you have to re-create your plot, and add in the colorbar
257257
again.
258258

259-
.. _`Data ranges`
259+
.. _`Data ranges`:
260260

261261
Examining a specific data range
262262
---------------------------------

doc/users/recipes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ objects in a numpy record array::
101101
array([2004-08-19, 2004-08-20, 2004-08-23, ..., 2008-10-10, 2008-10-13,
102102
2008-10-14], dtype=object)
103103

104-
The dtype of the numpy record array for the field 'date' is '|O4'
104+
The dtype of the numpy record array for the field ``date`` is ``|O4``
105105
which means it is a 4-byte python object pointer; in this case the
106106
objects are datetime.date instances, which we can see when we print
107107
some samples in the ipython terminal window.
@@ -130,7 +130,7 @@ the x locations are formatted the same way the tick labels are, eg
130130
"Dec 2004". What we'd like is for the location in the toolbar to have
131131
a higher degree of precision, eg giving us the exact date out mouse is
132132
hovering over. To fix the first problem, we can use
133-
method:`matplotlib.figure.Figure.autofmt_xdate` and to fix the second
133+
:func:`matplotlib.figure.Figure.autofmt_xdate` and to fix the second
134134
problem we can use the ``ax.fmt_xdata`` attribute which can be set to
135135
any function that takes a scalar and returns a string. matplotlib has
136136
a number of date formatters built in, so we'll use one of those.

lib/matplotlib/axes.py

Lines changed: 75 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3819,7 +3819,7 @@ def plot_date(self, x, y, fmt='bo', tz=None, xdate=True, ydate=False,
38193819
"""
38203820
call signature::
38213821
3822-
plot_date(x, y, fmt='bo', tz=None, xdate=True, ydate=False, **kwargs)
3822+
plot_date(x, y, fmt='bo', tz=None, xdate=True, ydate=False, **kwargs)
38233823
38243824
Similar to the :func:`~matplotlib.pyplot.plot` command, except
38253825
the *x* or *y* (or both) data is considered to be dates, and the
@@ -3830,18 +3830,18 @@ def plot_date(self, x, y, fmt='bo', tz=None, xdate=True, ydate=False,
38303830
38313831
Keyword arguments:
38323832
3833-
*fmt*: string
3834-
The plot format string.
3833+
*fmt*: string
3834+
The plot format string.
38353835
3836-
*tz*: [ None | timezone string ]
3837-
The time zone to use in labeling dates. If *None*, defaults to rc
3838-
value.
3836+
*tz*: [ None | timezone string ]
3837+
The time zone to use in labeling dates. If *None*, defaults to rc
3838+
value.
38393839
3840-
*xdate*: [ True | False ]
3841-
If *True*, the *x*-axis will be labeled with dates.
3840+
*xdate*: [ True | False ]
3841+
If *True*, the *x*-axis will be labeled with dates.
38423842
3843-
*ydate*: [ False | True ]
3844-
If *True*, the *y*-axis will be labeled with dates.
3843+
*ydate*: [ False | True ]
3844+
If *True*, the *y*-axis will be labeled with dates.
38453845
38463846
Note if you are using custom date tickers and formatters, it
38473847
may be necessary to set the formatters/locators after the call
@@ -3861,14 +3861,12 @@ def plot_date(self, x, y, fmt='bo', tz=None, xdate=True, ydate=False,
38613861
38623862
.. seealso::
38633863
3864-
:mod:`~matplotlib.dates`
3865-
for helper functions
3864+
:mod:`~matplotlib.dates` for helper functions
38663865
38673866
:func:`~matplotlib.dates.date2num`,
38683867
:func:`~matplotlib.dates.num2date` and
3869-
:func:`~matplotlib.dates.drange`
3870-
for help on creating the required floating point
3871-
dates.
3868+
:func:`~matplotlib.dates.drange` for help on creating the required
3869+
floating point dates.
38723870
"""
38733871

38743872
if not self._hold: self.cla()
@@ -5907,12 +5905,12 @@ def hexbin(self, x, y, C = None, gridsize = 100, bins = None,
59075905
"""
59085906
call signature::
59095907
5910-
hexbin(x, y, C = None, gridsize = 100, bins = None,
5911-
xscale = 'linear', yscale = 'linear',
5912-
cmap=None, norm=None, vmin=None, vmax=None,
5913-
alpha=None, linewidths=None, edgecolors='none'
5914-
reduce_C_function = np.mean, mincnt=None, marginals=True
5915-
**kwargs)
5908+
hexbin(x, y, C = None, gridsize = 100, bins = None,
5909+
xscale = 'linear', yscale = 'linear',
5910+
cmap=None, norm=None, vmin=None, vmax=None,
5911+
alpha=None, linewidths=None, edgecolors='none'
5912+
reduce_C_function = np.mean, mincnt=None, marginals=True
5913+
**kwargs)
59165914
59175915
Make a hexagonal binning plot of *x* versus *y*, where *x*,
59185916
*y* are 1-D sequences of the same length, *N*. If *C* is None
@@ -5931,84 +5929,84 @@ def hexbin(self, x, y, C = None, gridsize = 100, bins = None,
59315929
59325930
Optional keyword arguments:
59335931
5934-
*gridsize*: [ 100 | integer ]
5935-
The number of hexagons in the *x*-direction, default is
5936-
100. The corresponding number of hexagons in the
5937-
*y*-direction is chosen such that the hexagons are
5938-
approximately regular. Alternatively, gridsize can be a
5939-
tuple with two elements specifying the number of hexagons
5940-
in the *x*-direction and the *y*-direction.
5932+
*gridsize*: [ 100 | integer ]
5933+
The number of hexagons in the *x*-direction, default is
5934+
100. The corresponding number of hexagons in the
5935+
*y*-direction is chosen such that the hexagons are
5936+
approximately regular. Alternatively, gridsize can be a
5937+
tuple with two elements specifying the number of hexagons
5938+
in the *x*-direction and the *y*-direction.
59415939
5942-
*bins*: [ None | 'log' | integer | sequence ]
5943-
If *None*, no binning is applied; the color of each hexagon
5944-
directly corresponds to its count value.
5940+
*bins*: [ None | 'log' | integer | sequence ]
5941+
If *None*, no binning is applied; the color of each hexagon
5942+
directly corresponds to its count value.
59455943
5946-
If 'log', use a logarithmic scale for the color
5947-
map. Internally, :math:`log_{10}(i+1)` is used to
5948-
determine the hexagon color.
5944+
If 'log', use a logarithmic scale for the color
5945+
map. Internally, :math:`log_{10}(i+1)` is used to
5946+
determine the hexagon color.
59495947
5950-
If an integer, divide the counts in the specified number
5951-
of bins, and color the hexagons accordingly.
5948+
If an integer, divide the counts in the specified number
5949+
of bins, and color the hexagons accordingly.
59525950
5953-
If a sequence of values, the values of the lower bound of
5954-
the bins to be used.
5951+
If a sequence of values, the values of the lower bound of
5952+
the bins to be used.
59555953
5956-
*xscale*: [ 'linear' | 'log' ]
5957-
Use a linear or log10 scale on the horizontal axis.
5954+
*xscale*: [ 'linear' | 'log' ]
5955+
Use a linear or log10 scale on the horizontal axis.
59585956
5959-
*scale*: [ 'linear' | 'log' ]
5960-
Use a linear or log10 scale on the vertical axis.
5957+
*scale*: [ 'linear' | 'log' ]
5958+
Use a linear or log10 scale on the vertical axis.
59615959
5962-
*mincnt*: None | a positive integer
5963-
If not None, only display cells with more than *mincnt*
5964-
number of points in the cell
5960+
*mincnt*: None | a positive integer
5961+
If not None, only display cells with more than *mincnt*
5962+
number of points in the cell
59655963
5966-
*marginals*: True|False
5967-
if marginals is True, plot the marginal density as
5968-
colormapped rectagles along the bottom of the x-axis and
5969-
left of the y-axis
5964+
*marginals*: True|False
5965+
if marginals is True, plot the marginal density as
5966+
colormapped rectagles along the bottom of the x-axis and
5967+
left of the y-axis
59705968
5971-
*extent*: [ None | scalars (left, right, bottom, top) ]
5972-
The limits of the bins. The default assigns the limits
5973-
based on gridsize, x, y, xscale and yscale.
5969+
*extent*: [ None | scalars (left, right, bottom, top) ]
5970+
The limits of the bins. The default assigns the limits
5971+
based on gridsize, x, y, xscale and yscale.
59745972
59755973
Other keyword arguments controlling color mapping and normalization
59765974
arguments:
59775975
5978-
*cmap*: [ None | Colormap ]
5979-
a :class:`matplotlib.cm.Colormap` instance. If *None*,
5980-
defaults to rc ``image.cmap``.
5976+
*cmap*: [ None | Colormap ]
5977+
a :class:`matplotlib.cm.Colormap` instance. If *None*,
5978+
defaults to rc ``image.cmap``.
59815979
5982-
*norm*: [ None | Normalize ]
5983-
:class:`matplotlib.colors.Normalize` instance is used to
5984-
scale luminance data to 0,1.
5980+
*norm*: [ None | Normalize ]
5981+
:class:`matplotlib.colors.Normalize` instance is used to
5982+
scale luminance data to 0,1.
59855983
5986-
*vmin*/*vmax*: scalar
5987-
*vmin* and *vmax* are used in conjunction with *norm* to normalize
5988-
luminance data. If either are *None*, the min and max of the color
5989-
array *C* is used. Note if you pass a norm instance, your settings
5990-
for *vmin* and *vmax* will be ignored.
5984+
*vmin*/*vmax*: scalar
5985+
*vmin* and *vmax* are used in conjunction with *norm* to normalize
5986+
luminance data. If either are *None*, the min and max of the color
5987+
array *C* is used. Note if you pass a norm instance, your settings
5988+
for *vmin* and *vmax* will be ignored.
59915989
5992-
*alpha*: scalar between 0 and 1, or None
5993-
the alpha value for the patches
5990+
*alpha*: scalar between 0 and 1, or None
5991+
the alpha value for the patches
59945992
5995-
*linewidths*: [ None | scalar ]
5996-
If *None*, defaults to rc lines.linewidth. Note that this
5997-
is a tuple, and if you set the linewidths argument you
5998-
must set it as a sequence of floats, as required by
5999-
:class:`~matplotlib.collections.RegularPolyCollection`.
5993+
*linewidths*: [ None | scalar ]
5994+
If *None*, defaults to rc lines.linewidth. Note that this
5995+
is a tuple, and if you set the linewidths argument you
5996+
must set it as a sequence of floats, as required by
5997+
:class:`~matplotlib.collections.RegularPolyCollection`.
60005998
60015999
Other keyword arguments controlling the Collection properties:
60026000
6003-
*edgecolors*: [ None | mpl color | color sequence ]
6004-
If 'none', draws the edges in the same color as the fill color.
6005-
This is the default, as it avoids unsightly unpainted pixels
6006-
between the hexagons.
6001+
*edgecolors*: [ None | mpl color | color sequence ]
6002+
If 'none', draws the edges in the same color as the fill color.
6003+
This is the default, as it avoids unsightly unpainted pixels
6004+
between the hexagons.
60076005
6008-
If *None*, draws the outlines in the default color.
6006+
If *None*, draws the outlines in the default color.
60096007
6010-
If a matplotlib color arg or sequence of rgba tuples, draws the
6011-
outlines in the specified color.
6008+
If a matplotlib color arg or sequence of rgba tuples, draws the
6009+
outlines in the specified color.
60126010
60136011
Here are the standard descriptions of all the
60146012
:class:`~matplotlib.collections.Collection` kwargs:

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def xscale(*args, **kwargs):
11401140
ax = gca()
11411141
ax.set_xscale(*args, **kwargs)
11421142
draw_if_interactive()
1143-
1143+
11441144
@docstring.dedent_interpd
11451145
def yscale(*args, **kwargs):
11461146
"""
@@ -1157,7 +1157,7 @@ def yscale(*args, **kwargs):
11571157
ax = gca()
11581158
ax.set_yscale(*args, **kwargs)
11591159
draw_if_interactive()
1160-
1160+
11611161
def xticks(*args, **kwargs):
11621162
"""
11631163
Set/Get the xlimits of the current ticklocs and labels::

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
2121
2. Included as inline content to the directive::
2222
23-
.. plot::
23+
.. plot::
2424
25-
import matplotlib.pyplot as plt
26-
import matplotlib.image as mpimg
27-
import numpy as np
28-
img = mpimg.imread('_static/stinkbug.png')
29-
imgplot = plt.imshow(img)
25+
import matplotlib.pyplot as plt
26+
import matplotlib.image as mpimg
27+
import numpy as np
28+
img = mpimg.imread('_static/stinkbug.png')
29+
imgplot = plt.imshow(img)
3030
3131
In HTML output, `plot` will include a .png file with a link to a high-res
3232
.png and .pdf. In LaTeX output, it will include a .pdf.

0 commit comments

Comments
 (0)