Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix documentation warnings #1108

Merged
merged 2 commits into from

2 participants

@mdboom
Owner

Fixes a number of documentation warnings and problems in master.

Fixes #892.

lib/matplotlib/axes.py
@@ -4432,8 +4432,7 @@ def legend(self, *args, **kwargs):
instance. If *prop* is a dictionary, a new instance will be
created with *prop*. If *None*, use rc settings.
- *fontsize*: [ size in points | 'xx-small' | 'x-small' | 'small' |
- 'medium' | 'large' | 'x-large' | 'xx-large' ]
+ *fontsize*: [ size in points | 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' ]
@pelson Collaborator
pelson added a note

Do we normally wrap these?

@mdboom Owner
mdboom added a note

It would be nice to, but doing so results in Sphinx warnings and incorrect rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pelson pelson commented on the diff
lib/matplotlib/axes.py
@@ -7828,6 +7827,8 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
ax.hist(12+3*np.random.randn(1000), label='women', alpha=0.5)
ax.legend()
+ .
@pelson Collaborator
pelson added a note

???

@mdboom Owner
mdboom added a note

When you have a literal block, you have to have a closing point at the same level on indentation from where it started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/matplotlib/axes.py
((6 lines not shown))
- The return value is (counts,xedges,yedges,Image)
+ The return value is `(counts, xedges, yedges, Image)`.
@pelson Collaborator
pelson added a note

Double back quotes needed to render as a code block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/matplotlib/stackplot.py
((8 lines not shown))
*y* : 2d array of dimension MxN, OR any number 1d arrays each of dimension
1xN. The data is assumed to be unstacked. Each of the following
- calls is legal:
+ calls is legal::
stackplot(x, y) # where y is MxN
@pelson Collaborator
pelson added a note

does this need indentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pelson pelson commented on the diff
doc/mpl_toolkits/mplot3d/tutorial.rst
@@ -68,7 +68,7 @@ Surface plots
Tri-Surface plots
=================
-.. automethod:: Axes3D.plot_trisurface
+.. automethod:: Axes3D.plot_trisurf
@pelson Collaborator
pelson added a note

Intentional (I've not been following trisurf/trisurface)?

@mdboom Owner
mdboom added a note

As far as I can tell, this was a typo in the docs. There has never been a method called trisurface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pelson pelson merged commit dc535b4 into from
@mdboom mdboom deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 17, 2012
  1. @mdboom

    Fix documentation warnings

    mdboom authored
Commits on Aug 19, 2012
  1. @mdboom

    Address comments in PR #1108.

    mdboom authored
This page is out of date. Refresh to see the latest.
View
2  doc/mpl_toolkits/mplot3d/tutorial.rst
@@ -68,7 +68,7 @@ Surface plots
Tri-Surface plots
=================
-.. automethod:: Axes3D.plot_trisurface
+.. automethod:: Axes3D.plot_trisurf
@pelson Collaborator
pelson added a note

Intentional (I've not been following trisurf/trisurface)?

@mdboom Owner
mdboom added a note

As far as I can tell, this was a typo in the docs. There has never been a method called trisurface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
.. plot:: mpl_examples/mplot3d/trisurf3d_demo.py
View
14 lib/matplotlib/animation.py
@@ -75,8 +75,6 @@ class MovieWriter(object):
The use of the context manager ensures that setup and cleanup are
performed as necessary.
- Attributes
- ----------
frame_format: string
The format used in writing frame data, defaults to 'rgba'
'''
@@ -85,8 +83,6 @@ def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
'''
Construct a new MovieWriter object.
- Parameters
- ----------
fps: int
Framerate for movie.
codec: string or None, optional
@@ -103,7 +99,7 @@ def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
movie utiltiy. The default is None, which passes the additional
argurments in the 'animation.extra_args' rcParam.
metadata: dict of string:string or None
- A dictionary of keys and values for metadata to include in the
+ A dictionary of keys and values for metadata to include in the
output file. Some keys that may be of use include:
title, artist, genre, subject, copyright, srcform, comment.
'''
@@ -140,9 +136,6 @@ def setup(self, fig, outfile, dpi, *args):
'''
Perform setup for writing the movie file.
- Parameters
- ----------
-
fig: `matplotlib.Figure` instance
The figure object that contains the information for frames
outfile: string
@@ -164,7 +157,7 @@ def saving(self, *args):
'''
Context manager to facilitate writing the movie file.
- *args are any parameters that should be passed to setup()
+ ``*args`` are any parameters that should be passed to `setup`.
'''
# This particular sequence is what contextlib.contextmanager wants
self.setup(*args)
@@ -254,9 +247,6 @@ def setup(self, fig, outfile, dpi, frame_prefix='_tmp', clear_temp=True):
'''
Perform setup for writing the movie file.
- Parameters
- ----------
-
fig: `matplotlib.Figure` instance
The figure object that contains the information for frames
outfile: string
View
65 lib/matplotlib/axes.py
@@ -4432,8 +4432,8 @@ def legend(self, *args, **kwargs):
instance. If *prop* is a dictionary, a new instance will be
created with *prop*. If *None*, use rc settings.
- *fontsize*: [ size in points | 'xx-small' | 'x-small' | 'small' |
- 'medium' | 'large' | 'x-large' | 'xx-large' ]
+ *fontsize*: [ size in points | 'xx-small' | 'x-small' |
+ 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' ]
Set the font size. May be either a size string, relative to
the default font size, or an absolute font size in points. This
argument is only used if prop is not specified.
@@ -5602,17 +5602,17 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5,
Returns a dictionary mapping each component of the boxplot
to a list of the :class:`matplotlib.lines.Line2D`
- instances created. That disctionary has the following keys
+ instances created. That dictionary has the following keys
(assuming vertical boxplots):
- boxes: the main body of the boxplot showing the quartiles
- and the median's confidence intervals if enabled.
- medians: horizonal lines at the median of each box.
- whiskers: the vertical lines extending to the most extreme,
- non-outlier data points.
- caps: the horizontal lines at the ends of the whiskers.
- fliers: points representing data that extend beyone the
- whiskers (outliers).
+ - boxes: the main body of the boxplot showing the quartiles
+ and the median's confidence intervals if enabled.
+ - medians: horizonal lines at the median of each box.
+ - whiskers: the vertical lines extending to the most extreme,
+ n-outlier data points.
+ - caps: the horizontal lines at the ends of the whiskers.
+ - fliers: points representing data that extend beyone the
+ whiskers (outliers).
**Example:**
@@ -7828,6 +7828,8 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
ax.hist(12+3*np.random.randn(1000), label='women', alpha=0.5)
ax.legend()
+ .
@pelson Collaborator
pelson added a note

???

@mdboom Owner
mdboom added a note

When you have a literal block, you have to have a closing point at the same level on indentation from where it started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
kwargs are used to update the properties of the
:class:`~matplotlib.patches.Patch` instances returned by *hist*:
@@ -8121,23 +8123,35 @@ def hist2d(self, x, y, bins = 10, range=None, normed=False, weights=None,
hist2d(x, y, bins = None, range=None, weights=None, cmin=None, cmax=None **kwargs)
Make a 2d histogram plot of *x* versus *y*, where *x*,
- *y* are 1-D sequences of the same length
+ *y* are 1-D sequences of the same length.
- The return value is (counts,xedges,yedges,Image)
+ The return value is ``(counts, xedges, yedges, Image)``.
Optional keyword arguments:
*bins*: [None | int | [int, int] | array_like | [array, array]]
+
The bin specification:
- If int, the number of bins for the two dimensions (nx=ny=bins).
- If [int, int], the number of bins in each dimension (nx, ny = bins).
- If array_like, the bin edges for the two dimensions (x_edges=y_edges=bins).
- If [array, array], the bin edges in each dimension (x_edges, y_edges = bins).
+
+ - If int, the number of bins for the two dimensions
+ (nx=ny=bins).
+
+ - If [int, int], the number of bins in each dimension
+ (nx, ny = bins).
+
+ - If array_like, the bin edges for the two dimensions
+ (x_edges=y_edges=bins).
+
+ - If [array, array], the bin edges in each dimension
+ (x_edges, y_edges = bins).
+
The default value is 10.
*range*: [*None* | array_like shape(2,2)]
- The leftmost and rightmost edges of the bins along each dimension (if not specified
- explicitly in the bins parameters): [[xmin, xmax], [ymin, ymax]]. All values outside of
- this range will be considered outliers and not tallied in the histogram.
+ The leftmost and rightmost edges of the bins along each
+ dimension (if not specified explicitly in the bins
+ parameters): [[xmin, xmax], [ymin, ymax]]. All values
+ outside of this range will be considered outliers and not
+ tallied in the histogram.
*normed*:[True|False]
Normalize histogram.
@@ -8147,12 +8161,15 @@ def hist2d(self, x, y, bins = 10, range=None, normed=False, weights=None,
An array of values w_i weighing each sample (x_i, y_i).
*cmin* : [None| scalar]
- All bins that has count less than cmin will not be displayed
- and these count values in the return value count histogram will also be set to nan upon return
+ All bins that has count less than cmin will not be
+ displayed and these count values in the return value
+ count histogram will also be set to nan upon return
*cmax* : [None| scalar]
- All bins that has count more than cmax will not be displayed (set to none before passing to imshow)
- and these count values in the return value count histogram will also be set to nan upon return
+ All bins that has count more than cmax will not be
+ displayed (set to none before passing to imshow) and
+ these count values in the return value count histogram
+ will also be set to nan upon return
Remaining keyword arguments are passed directly to :meth:pcolorfast
View
2  lib/matplotlib/projections/__init__.py
@@ -77,7 +77,7 @@ def projection_factory(projection, figure, rect, **kwargs):
Any other kwargs are passed along to the specific projection
constructor being used.
- .. deprecated::
+ .. deprecated:: 1.3
This routine is deprecated in favour of getting the projection
class directly with :func:`get_projection_class` and initialising it
View
17 lib/matplotlib/stackplot.py
@@ -15,26 +15,25 @@
def stackplot(axes, x, *args, **kwargs):
"""Draws a stacked area plot.
- Parameters
- ----------
*x* : 1d array of dimension N
+
*y* : 2d array of dimension MxN, OR any number 1d arrays each of dimension
1xN. The data is assumed to be unstacked. Each of the following
- calls is legal:
+ calls is legal::
- stackplot(x, y) # where y is MxN
- staclplot(x, y1, y2, y3, y4) # where y1, y2, y3, y4, are all 1xNm
+ stackplot(x, y) # where y is MxN
+ stackplot(x, y1, y2, y3, y4) # where y1, y2, y3, y4, are all 1xNm
Keyword arguments:
+
*colors* : A list or tuple of colors. These will be cycled through and
used to colour the stacked areas.
All other keyword arguments are passed to
:func:`~matplotlib.Axes.fill_between`
- Returns
- -------
- *r* : A list of :class:`~matplotlib.collections.PolyCollection`, one for
- each element in the stacked area plot.
+ Returns *r* : A list of
+ :class:`~matplotlib.collections.PolyCollection`, one for each
+ element in the stacked area plot.
"""
if len(args) == 1:
View
7 lib/matplotlib/streamplot.py
@@ -17,8 +17,6 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
minlength=0.1):
"""Draws streamlines of a vector flow.
- Parameters
- ----------
*x*, *y* : 1d arrays
an *evenly spaced* grid.
*u*, *v* : 2d arrays
@@ -48,9 +46,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
*minlength* : float
Minimum length of streamline in axes coordinates.
- Returns
- -------
- *streamlines* : :class:`~matplotlib.collections.LineCollection`
+ Returns *streamlines* : :class:`~matplotlib.collections.LineCollection`
Line collection with all streamlines as a series of line segments.
Currently, there is no way to differentiate between line segments
on different streamlines (other than manually checking that segments
@@ -552,4 +548,3 @@ def _gen_starting_points(shape):
if y <= yfirst:
yfirst +=1
direction = 'right'
-
View
10 lib/matplotlib/tight_layout.py
@@ -212,20 +212,25 @@ def get_renderer(fig):
def get_tight_layout_figure(fig, axes_list, renderer,
pad=1.08, h_pad=None, w_pad=None, rect=None):
"""
- return subplot parameters for tigh-layouted- figure with
- specified padding.
+ Return subplot parameters for tight-layouted-figure with specified
+ padding.
Parameters:
*fig* : figure instance
+
*axes_list* : a list of axes
+
*renderer* : renderer instance
+
*pad* : float
padding between the figure edge and the edges of subplots,
as a fraction of the font-size.
+
*h_pad*, *w_pad* : float
padding (height/width) between edges of adjacent subplots.
Defaults to `pad_inches`.
+
*rect* : if rect is given, it is interpreted as a rectangle
(left, bottom, right, top) in the normalized figure
coordinate that the whole subplots area (including
@@ -323,4 +328,3 @@ def get_tight_layout_figure(fig, axes_list, renderer,
rect=(left, bottom, right, top))
return kwargs
-
View
5 lib/matplotlib/widgets.py
@@ -1518,8 +1518,8 @@ class Lasso(AxesWidget):
"""Selection curve of an arbitrary shape.
The selected path can be used in conjunction with
- :function:`~matplotlib.path.Path.contains_point` to select
- data points from an image.
+ :func:`~matplotlib.path.Path.contains_point` to select data points
+ from an image.
Unlike :class:`LassoSelector`, this must be initialized with a starting
point `xy`, and the `Lasso` events are destroyed upon release.
@@ -1578,4 +1578,3 @@ def onmove(self, event):
self.canvas.blit(self.ax.bbox)
else:
self.canvas.draw_idle()
-
Something went wrong with that request. Please try again.