Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation warnings #1108

Merged
merged 2 commits into from Aug 20, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/mpl_toolkits/mplot3d/tutorial.rst
Expand Up @@ -68,7 +68,7 @@ Surface plots

Tri-Surface plots
=================
.. automethod:: Axes3D.plot_trisurface
.. automethod:: Axes3D.plot_trisurf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


.. plot:: mpl_examples/mplot3d/trisurf3d_demo.py

Expand Down
14 changes: 2 additions & 12 deletions lib/matplotlib/animation.py
Expand Up @@ -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'
'''
Expand All @@ -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
Expand All @@ -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.
'''
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
65 changes: 41 additions & 24 deletions lib/matplotlib/axes.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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:**

Expand Down Expand Up @@ -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()

.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


kwargs are used to update the properties of the
:class:`~matplotlib.patches.Patch` instances returned by *hist*:

Expand Down Expand Up @@ -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.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/projections/__init__.py
Expand Up @@ -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
Expand Down
17 changes: 8 additions & 9 deletions lib/matplotlib/stackplot.py
Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions lib/matplotlib/streamplot.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -552,4 +548,3 @@ def _gen_starting_points(shape):
if y <= yfirst:
yfirst +=1
direction = 'right'

10 changes: 7 additions & 3 deletions lib/matplotlib/tight_layout.py
Expand Up @@ -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
Expand Down Expand Up @@ -323,4 +328,3 @@ def get_tight_layout_figure(fig, axes_list, renderer,
rect=(left, bottom, right, top))

return kwargs

5 changes: 2 additions & 3 deletions lib/matplotlib/widgets.py
Expand Up @@ -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.
Expand Down Expand Up @@ -1578,4 +1578,3 @@ def onmove(self, event):
self.canvas.blit(self.ax.bbox)
else:
self.canvas.draw_idle()