From 2b7ce9ed80003015bf258c44611cf30bf32cc9d6 Mon Sep 17 00:00:00 2001 From: jdh2358 Date: Thu, 29 Sep 2011 15:05:26 -0500 Subject: [PATCH] * Remove matplotlib.legend from artist_api.rst since it is document in legend_api * Fix pyplot docstring :module: -> :mod to remove error: Unknown interpreted text role "module". * Fix pyplot tight_layout docstring to get rid of 'Unexpected section title.' error * reformatted docstring in tight_layout.auto_adjust_subplotpars * fix what's new bullet list ends w/o blank line issues * remove plotting.rst and arraydata.rst stub docs * Added environment_variables.rst to FAQ index * removed normed warning on Axes.hist * fix an nxutils.point_inside_poly docstring definition list bug --- doc/api/artist_api.rst | 7 -- doc/faq/index.rst | 2 + doc/matplotlibrc | 1 + doc/users/arraydata.rst | 72 --------------- doc/users/plotting.rst | 155 --------------------------------- doc/users/whats_new.rst | 2 + lib/matplotlib/axes.py | 12 +-- lib/matplotlib/figure.py | 7 +- lib/matplotlib/gridspec.py | 7 +- lib/matplotlib/pyplot.py | 9 +- lib/matplotlib/tight_layout.py | 28 +++--- src/nxutils.c | 2 +- 12 files changed, 38 insertions(+), 266 deletions(-) delete mode 100644 doc/users/arraydata.rst delete mode 100644 doc/users/plotting.rst diff --git a/doc/api/artist_api.rst b/doc/api/artist_api.rst index cb662d6c71ca..2ec41bb5c94f 100644 --- a/doc/api/artist_api.rst +++ b/doc/api/artist_api.rst @@ -15,13 +15,6 @@ artists :undoc-members: :show-inheritance: -:mod:`matplotlib.legend` -============================= - -.. automodule:: matplotlib.legend - :members: - :undoc-members: - :show-inheritance: :mod:`matplotlib.lines` ============================= diff --git a/doc/faq/index.rst b/doc/faq/index.rst index ac1fc7b1b1b7..b41610b05652 100644 --- a/doc/faq/index.rst +++ b/doc/faq/index.rst @@ -18,3 +18,5 @@ The Matplotlib FAQ usage_faq.rst howto_faq.rst troubleshooting_faq.rst + environment_variables_faq.rst + diff --git a/doc/matplotlibrc b/doc/matplotlibrc index aca4828a0799..5c9685987e24 100644 --- a/doc/matplotlibrc +++ b/doc/matplotlibrc @@ -13,3 +13,4 @@ docstring.hardcopy : True # set this when you want to generate hardcopy docstri #examples.download : False # False to bypass downloading mechanism #examples.directory : /your/path/to/sample_data/ # directory to look in if download is false + diff --git a/doc/users/arraydata.rst b/doc/users/arraydata.rst deleted file mode 100644 index 9db3c505eace..000000000000 --- a/doc/users/arraydata.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _arraydata: - -*********************************************** -Plotting 2-D arrays or functions of 2 variables -*********************************************** - -In this chapter we will address methods for plotting a -scalar function of two variables. Here are some examples: - -* A photographic image, represented as a 2-D array of - colors; the grid is regular, with each element of the - array corresponding to a square pixel. - -* Earth surface elevation and ocean bottom topography, - represented as a 2-D array of heights; the grid is - rectangular in latitude and longitude, but the latitude - increment may not be uniform--often it will decrease - toward the poles. - -* A mathematical function of two variables, such as a - bivariate Gaussian probability density. - -Note: in this chapter we will assume the data to be plotted -are on a grid. If you have scalar data of two -variables, but the data are not on a grid - for -example, sea level at island stations - then you will need -to use an interpolation or other gridding routine -before you can use any of the -plotting methods we will discuss here. - -As a 2-D plotting library, matplotlib offers two basic -styles of plot for scalar functions of two variables: an -image style and a contour style. The image style renders -the data as either a continuously-varying field of color or -a set of contiguous colored quadrilaterals. Hence, the -image style is a direct representation of the data array. -The contour style is less direct; isolines of the data are -calculated and then either plotted as lines or used to delimit -colored regions. - -.. _image_styles: - -Image (or pcolor) styles -======================== - -some text - -.. _image: - -image ------ - -image text and example - -.. _pcolor: - -pcolor ------- - -pcolor and pcolorfast, including quadmesh variant - -.. _contour: - -Contouring -========== - -contour and contourf - - - - - diff --git a/doc/users/plotting.rst b/doc/users/plotting.rst deleted file mode 100644 index 18f0b0e2fd83..000000000000 --- a/doc/users/plotting.rst +++ /dev/null @@ -1,155 +0,0 @@ -.. _plotting-guide: - -*************** -Plotting guide -*************** - -An in-depth, tutorial style guide to the matplotlib plotting -functions, which explains the most important keyword arguments with -examples and figures. - -.. _image-plots: - -Images -====== -:func:`~matplotlib.pyplot.imshow` - -TODO; see :ref:`how-to-contribute-docs`. - - -.. _colormaps-plots: - -Colormaps -========== - - -TODO; see :ref:`how-to-contribute-docs`. - -.. _colorbars-plots: - -Colorbars -========== - -:func:`~matplotlib.pyplot.colorbar` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _contour-plots: - -Contouring -========== - -:func:`~matplotlib.pyplot.contour` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _scatter-plots: - -Scatter plots -============== - -:func:`~matplotlib.pyplot.scatter` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _log-plots: - -Log plots -============== - -:func:`~matplotlib.pyplot.semilogx`, :func:`~matplotlib.pyplot.semilogy` and :func:`~matplotlib.pyplot.loglog` - -.. _polar-plots: - -Polar plots -============== - -:func:`~matplotlib.pyplot.polar` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _filled-plots: - -Filled plots -============== - -:func:`~matplotlib.pyplot.fill` and :mod:`~matplotlib.patches` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _bar-plots: - -Bar charts, histograms and errorbars -====================================== - -:func:`~matplotlib.pyplot.bar`, :func:`~matplotlib.pyplot.barh`, -:func:`~matplotlib.pyplot.errorbar` and -:func:`~matplotlib.pyplot.hist` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _time-series-plots: - -Timeseries plots -========================== - -:func:`~matplotlib.pyplot.acorr`, :func:`~matplotlib.pyplot.xcorr`, :func:`~matplotlib.pyplot.psd`, :func:`~matplotlib.pyplot.csd`, -:func:`~matplotlib.pyplot.cohere`, :func:`~matplotlib.pyplot.specgram` -and the windowing and detrending functions in :mod:`matplotlib.mlab`. - -TODO; see :ref:`how-to-contribute-docs`. - -.. _sparsity-plots: - -Sparsity plots -========================== - -:func:`~matplotlib.pyplot.spy` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _boxplots-plots: - -Boxplots -========================== - -:func:`~matplotlib.pyplot.boxplot` - -TODO; see :ref:`how-to-contribute-docs`. - -.. _date-plots: - -Working with dates -========================== - -TODO; see :ref:`how-to-contribute-docs`. - -.. _masked-data-plots: - -Working with masked/missing data -================================== - -TODO; see :ref:`how-to-contribute-docs`. - -.. _collections-plots: - -Working with collections -================================== - -TODO; see :ref:`how-to-contribute-docs`. - -.. _legend-plots: - -Creating figure and axes legends -================================== -:func:`~matplotlib.pyplot.legend` and :func:`~matplotlib.pyplot.figlegend` - -:ref:`plotting-guide-legend` - -Annotating plot -=============== -:func:`~matplotlib.pyplot.text` and :func:`~matplotlib.pyplot.annotate` - -:ref:`plotting-guide-annotation` - - diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index 2613d4d1261f..65bdb1f64d6e 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -133,10 +133,12 @@ as 2D plotting, Ben Root has made several improvements to the * Most 3D plotting functions now support empty inputs * Ticker offset display added: + .. plot:: mpl_examples/mplot3d/offset_demo.py * :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.contourf` gains *zdir* and *offset* kwargs. You can now do this: + .. plot:: mpl_examples/mplot3d/contourf3d_demo2.py Numerix support removed diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index ea8657b186e9..db2319383ed7 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -2067,7 +2067,7 @@ def grid(self, b=None, which='major', axis='both', **kwargs): *axis* can be 'both' (default), 'x', or 'y' to control which set of gridlines are drawn. - *kawrgs* are used to set the grid line properties, eg:: + *kwargs* are used to set the grid line properties, eg:: ax.grid(color='r', linestyle='-', linewidth=2) @@ -7662,16 +7662,6 @@ def hist(x, bins=10, range=None, normed=False, weights=None, db = np.diff(bins) m = (m.astype(float) / db) / m.sum() n.append(m) - if normed and db.std() > 0.01 * db.mean(): - warnings.warn(""" - This release fixes a normalization bug in the NumPy histogram - function prior to version 1.5, occuring with non-uniform - bin widths. The returned and plotted value is now a density: - n / (N * bin width), - where n is the bin count and N the total number of points. - """) - - if cumulative: slc = slice(None) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index de9c1a934cc6..5cef5b222759 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1310,10 +1310,11 @@ def get_tightbbox(self, renderer): def tight_layout(self, renderer=None, pad=1.2, h_pad=None, w_pad=None): - """Adjust subplot parameters to give specified padding. + """ + Adjust subplot parameters to give specified padding. + + Parameters: - Parameters - ---------- pad : float padding between the figure edge and the edges of subplots, as a fraction of the font-size. h_pad, w_pad : float diff --git a/lib/matplotlib/gridspec.py b/lib/matplotlib/gridspec.py index 9367cb485bde..8fc3e8cb4fd0 100644 --- a/lib/matplotlib/gridspec.py +++ b/lib/matplotlib/gridspec.py @@ -268,10 +268,11 @@ def locally_modified_subplot_params(self): def tight_layout(self, fig, renderer=None, pad=1.2, h_pad=None, w_pad=None, rect=None): - """Adjust subplot parameters to give specified padding. + """ + Adjust subplot parameters to give specified padding. - Parameters - ---------- + Parameters: + pad : float padding between the figure edge and the edges of subplots, as a fraction of the font-size. h_pad, w_pad : float diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index f5dd5e1df2cf..e15c640cf765 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -457,7 +457,7 @@ def draw(): A more object-oriented alternative, given any :class:`~matplotlib.figure.Figure` instance, :attr:`fig`, that - was created using a :module:`~matplotlib.pyplot` function, is:: + was created using a :mod:`~matplotlib.pyplot` function, is:: fig.canvas.draw() @@ -1035,10 +1035,11 @@ def subplot_tool(targetfig=None): def tight_layout(pad=1.2, h_pad=None, w_pad=None): - """Adjust subplot parameters to give specified padding. + """ + Adjust subplot parameters to give specified padding. + + Parameters: - Parameters - ---------- pad : float padding between the figure edge and the edges of subplots, as a fraction of the font-size. h_pad, w_pad : float diff --git a/lib/matplotlib/tight_layout.py b/lib/matplotlib/tight_layout.py index 1098e599acd7..52e2236098fa 100644 --- a/lib/matplotlib/tight_layout.py +++ b/lib/matplotlib/tight_layout.py @@ -42,20 +42,28 @@ def auto_adjust_subplotpars(fig, renderer, Return a dictionary of subplot parameters so that spacing between subplots are adjusted. Note that this function ignore geometry information of subplot itself, but uses what is given by - nrows_ncols and num1num2_list parameteres. Also, the results could be - incorrect if some subplots have adjustable=datalim. + *nrows_ncols* and *num1num2_list* parameteres. Also, the results could be + incorrect if some subplots have ``adjustable=datalim``. - Parameters - ---------- - nrows_ncols : number of rows and number of columns of the grid. - num1num2_list : list of numbers specifying the area occupied by the subplot - subplot_list : list of subplots that will be used to calcuate optimal subplot_params. + Parameters: + + nrows_ncols + number of rows and number of columns of the grid. + + num1num2_list + list of numbers specifying the area occupied by the subplot + + subplot_list + list of subplots that will be used to calcuate optimal subplot_params. + pad : float - padding between the figure edge and the edges of subplots, as a fraction of the font-size. + 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. + padding (height/width) between edges of adjacent subplots. Defaults to `pad_inches`. - rect : [left, bottom, right, top] in normalized (0, 1) figure coordinates. + + rect + [left, bottom, right, top] in normalized (0, 1) figure coordinates. """ diff --git a/src/nxutils.c b/src/nxutils.c index c88bdf40c6df..e7d69793c2e5 100644 --- a/src/nxutils.c +++ b/src/nxutils.c @@ -231,7 +231,7 @@ static PyMethodDef module_methods[] = { "Return a boolean ndarray, True for points inside the polygon.\n\n" "*xypoints*\n a sequence of N x,y pairs.\n" "*xyverts*\n sequence of x,y vertices of the polygon.\n" - "*mask* an ndarray of length N.\n\n" + "*mask*\n an ndarray of length N.\n\n" "A point on the boundary may be treated as inside or outside.\n" "See `pnpoly `_\n"}, {NULL} /* Sentinel */