From: <ds...@us...> - 2008-06-08 23:34:05
|
Revision: 5426 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5426&view=rev Author: dsdale Date: 2008-06-08 16:34:01 -0700 (Sun, 08 Jun 2008) Log Message: ----------- finish converting axes.py docstrings to ReST Modified Paths: -------------- trunk/matplotlib/doc/api/index.rst trunk/matplotlib/doc/api/pyplot_api.rst trunk/matplotlib/doc/faq/environment_variables_faq.rst trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/doc/api/index.rst =================================================================== --- trunk/matplotlib/doc/api/index.rst 2008-06-08 20:31:47 UTC (rev 5425) +++ trunk/matplotlib/doc/api/index.rst 2008-06-08 23:34:01 UTC (rev 5426) @@ -12,5 +12,6 @@ .. toctree:: artist_api.rst + axes_api.rst pyplot_api.rst Modified: trunk/matplotlib/doc/api/pyplot_api.rst =================================================================== --- trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-08 20:31:47 UTC (rev 5425) +++ trunk/matplotlib/doc/api/pyplot_api.rst 2008-06-08 23:34:01 UTC (rev 5426) @@ -7,4 +7,5 @@ ============================= .. automodule:: matplotlib.pyplot - :members: \ No newline at end of file + :members: + :undoc-members: \ No newline at end of file Modified: trunk/matplotlib/doc/faq/environment_variables_faq.rst =================================================================== --- trunk/matplotlib/doc/faq/environment_variables_faq.rst 2008-06-08 20:31:47 UTC (rev 5425) +++ trunk/matplotlib/doc/faq/environment_variables_faq.rst 2008-06-08 23:34:01 UTC (rev 5426) @@ -4,18 +4,12 @@ Environment Variables ********************* -====================== ======================================================= -Environment Variable Description -====================== ======================================================= -.. envvar:: PATH The list of directories searched to find executable - programs -.. envvar:: PYTHONPATH The list of directories that is searched to find Python - packages and modules -====================== ======================================================= +.. envvar:: PATH: + The list of directories searched to find executable programs +.. envvar:: PYTHONPATH: + The list of directories that is searched to find Python packages and modules - - Setting Environment Variables ============================= Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-08 20:31:47 UTC (rev 5425) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-08 23:34:01 UTC (rev 5426) @@ -452,7 +452,6 @@ connect to are 'xlim_changed' and 'ylim_changed' and the callback will be called with func(ax) where ax is the Axes instance - """ name = "rectilinear" @@ -574,7 +573,7 @@ def set_figure(self, fig): """ - Set the Axes figure + Set the Axes' figure accepts a Figure instance """ @@ -926,24 +925,24 @@ adjustable: - ======== ============================ - value description - ======== ============================ - 'box' change physical size of axes - 'datalim' change xlim or ylim - ======== ============================ + ========= ============================ + value description + ========= ============================ + 'box' change physical size of axes + 'datalim' change xlim or ylim + ========= ============================ anchor: - ==== ===================== - value description - ==== ===================== - 'C' centered - 'SW' lower left corner - 'S' middle of bottom edge - 'SE' lower right corner + ===== ===================== + value description + ===== ===================== + 'C' centered + 'SW' lower left corner + 'S' middle of bottom edge + 'SE' lower right corner etc. - ==== ===================== + ===== ===================== """ if aspect in ('normal', 'auto'): @@ -963,7 +962,7 @@ def set_adjustable(self, adjustable): """ - ACCEPTS: ['box' | 'datalim'] + ACCEPTS: [ 'box' | 'datalim' ] """ if adjustable in ('box', 'datalim'): self._adjustable = adjustable @@ -1105,8 +1104,6 @@ #print 'New x0, x1:', x0, x1 #print 'New xsize, ysize/xsize', x1-x0, ysize/(x1-x0) - - def axis(self, *v, **kwargs): ''' Convenience method for manipulating the x and y view limits @@ -1165,7 +1162,6 @@ return v - def get_child_artists(self): """ Return a list of artists the axes contains. Deprecated @@ -1434,6 +1430,7 @@ self.set_position(new_position, 'active') #### Drawing + def draw(self, renderer=None, inframe=False): "Draw everything (plot lines, axes, labels)" if renderer is None: @@ -1551,7 +1548,7 @@ """ Set whether the axes rectangle patch is drawn - ACCEPTS: True|False + ACCEPTS: [ True | False ] """ self._frameon = b @@ -1565,7 +1562,7 @@ """ Set whether the axis ticks and gridlines are above or below most artists - ACCEPTS: True|False + ACCEPTS: [ True | False ] """ self._axisbelow = b @@ -1822,8 +1819,10 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs): """ - set_xticklabels(labels, fontdict=None, minor=False, **kwargs) + call signature:: + set_xticklabels(labels, fontdict=None, minor=False, **kwargs) + Set the xtick labels with list of strings labels Return a list of axis text instances. @@ -1884,21 +1883,26 @@ def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs): """ - set_ylim(self, *args, **kwargs): + call signature:: - Set the limits for the yaxis; v = [ymin, ymax] + set_ylim(self, *args, **kwargs): - set_ylim((valmin, valmax)) - set_ylim(valmin, valmax) - set_ylim(ymin=1) # ymax unchanged - set_ylim(ymax=1) # ymin unchanged + Set the limits for the yaxis; v = [ymin, ymax]:: - Valid kwargs: + set_ylim((valmin, valmax)) + set_ylim(valmin, valmax) + set_ylim(ymin=1) # ymax unchanged + set_ylim(ymax=1) # ymin unchanged - ymin : the min of the ylim - ymax : the max of the ylim - emit : notify observers of lim change + Keyword arguments: + ymin: scalar + the min of the ylim + ymax: scalar + the max of the ylim + emit: [ True | False ] + notify observers of lim change + Returns the current ylimits as a length 2 tuple ACCEPTS: len(2) sequence of floats @@ -1937,8 +1941,10 @@ def set_yscale(self, value, **kwargs): """ - SET_YSCALE(value) + call signature:: + set_yscale(value) + Set the scaling of the y-axis: %(scale)s ACCEPTS: [%(scale)s] @@ -1960,6 +1966,11 @@ Set the y ticks with list of ticks ACCEPTS: sequence of floats + + Keyword arguments: + + minor: [ False | True ] + Sets the minor ticks if True """ return self.yaxis.set_ticks(ticks, minor=minor) @@ -1977,8 +1988,10 @@ def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs): """ - set_yticklabels(labels, fontdict=None, minor=False, **kwargs) + call signature:: + set_yticklabels(labels, fontdict=None, minor=False, **kwargs) + Set the ytick labels with list of strings labels. Return a list of Text instances. @@ -2100,7 +2113,7 @@ """ Set whether the axes responds to navigation toolbar commands - ACCEPTS: True|False + ACCEPTS: [ True | False ] """ self._navigate = b @@ -2124,10 +2137,11 @@ x, y are the mouse coordinates in display coords. button is the mouse button number: - 1: LEFT - 2: MIDDLE - 3: RIGHT + * 1: LEFT + * 2: MIDDLE + * 3: RIGHT + Intended to be overridden by new projection types. """ self._pan_start = cbook.Bunch( @@ -2153,10 +2167,11 @@ Called when the mouse moves during a pan operation. button is the mouse button number: - 1: LEFT - 2: MIDDLE - 3: RIGHT + * 1: LEFT + * 2: MIDDLE + * 3: RIGHT + key is a "shift" key x, y are the mouse coordinates in display coords. @@ -2221,10 +2236,14 @@ def set_cursor_props(self, *args): """ - Set the cursor property as - ax.set_cursor_props(linewidth, color) OR - ax.set_cursor_props((linewidth, color)) + Set the cursor property as:: + ax.set_cursor_props(linewidth, color) + + or:: + + ax.set_cursor_props((linewidth, color)) + ACCEPTS: a (float, color) tuple """ if len(args)==1: @@ -2240,7 +2259,7 @@ """ Register observers to be notified when certain events occur. Register with callback functions with the following signatures. The function - has the following signature + has the following signature:: func(ax) # where ax is the instance making the callback. @@ -2365,8 +2384,6 @@ ds.sort() return ds[0][1] - - #### Labelling def get_title(self): @@ -2377,8 +2394,10 @@ def set_title(self, label, fontdict=None, **kwargs): """ - SET_TITLE(label, fontdict=None, **kwargs): + call signature:: + set_title(label, fontdict=None, **kwargs): + Set the title for the axes. See the text docstring for information of how override and the optional args work @@ -2409,8 +2428,10 @@ def set_xlabel(self, xlabel, fontdict=None, **kwargs): """ - SET_XLABEL(xlabel, fontdict=None, **kwargs) + call signature:: + set_xlabel(xlabel, fontdict=None, **kwargs) + Set the label for the xaxis. See the text docstring for information of how override and the optional args work. @@ -2435,8 +2456,10 @@ def set_ylabel(self, ylabel, fontdict=None, **kwargs): """ - SET_YLABEL(ylabel, fontdict=None, **kwargs) + call signature:: + set_ylabel(ylabel, fontdict=None, **kwargs) + Set the label for the yaxis See the text doctstring for information of how override and @@ -2535,13 +2558,10 @@ """ call signature:: - annotate(s, xy, - xytext=None, - xycoords='data', - textcoords='data', - arrowprops=None, - **props) + annotate(s, xy, xytext=None, xycoords='data', + textcoords='data', arrowprops=None, **kwargs) + Keyword arguments: %(Annotation)s """ a = mtext.Annotation(*args, **kwargs) @@ -2802,8 +2822,10 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid', label='', **kwargs): """ - VLINES(x, ymin, ymax, color='k') + call signature:: + vlines(x, ymin, ymax, color='k') + Plot vertical lines at each x from ymin to ymax. ymin or ymax can be scalars or len(x) numpy arrays. If they are scalars, then the respective values are constant, else the heights of the lines are @@ -2813,7 +2835,7 @@ colors is a line collections color args, either a single color or a len(x) list of colors - linestyle is one of solid|dashed|dashdot|dotted + linestyle is one of [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ] Returns the collections.LineCollection that was added @@ -3199,8 +3221,11 @@ def xcorr(self, x, y, normed=False, detrend=mlab.detrend_none, usevlines=False, maxlags=None, **kwargs): """ - XCORR(x, y, normed=False, detrend=mlab.detrend_none, usevlines=False, \*\*kwargs): + call signature:: + xcorr(x, y, normed=False, detrend=mlab.detrend_none, + usevlines=False, **kwargs): + Plot the cross correlation between x and y. If normed=True, normalize the data but the cross correlation at 0-th lag. x and y are detrended by the detrend callable (default no @@ -3220,10 +3245,11 @@ to draw vertical lines from the origin to the acorr. Otherwise the plotstyle is determined by the kwargs, which are Line2D properties. If usevlines, the return value is lags, c, - linecol, b where linecol is the collections.LineCollection and b is the x-axis + linecol, b where linecol is the collections.LineCollection and b is the + x-axis - if usevlines=True, kwargs are passed onto Axes.vlines - if usevlines=False, kwargs are passed onto Axes.plot + if ``usevlines=True``, kwargs are passed onto Axes.vlines + if ``usevlines=False``, kwargs are passed onto Axes.plot maxlags is a positive integer detailing the number of lags to show. The default value of None will return all ``(2*len(x)-1)`` lags. @@ -3401,7 +3427,6 @@ self.legend_ = mlegend.Legend(self, handles, labels, **kwargs) return self.legend_ - #### Specialized plotting def step(self, x, y, *args, **kwargs): @@ -3959,9 +3984,6 @@ if autopct is None: return slices, texts else: return slices, texts, autotexts - - - def errorbar(self, x, y, yerr=None, xerr=None, fmt='-', ecolor=None, elinewidth=None, capsize=3, barsabove=False, lolims=False, uplims=False, @@ -4946,9 +4968,9 @@ self.autoscale_view() return patches fill.__doc__ = cbook.dedent(fill.__doc__) % martist.kwdocd + #### plotting z(x,y): imshow, pcolor and relatives, contour - def imshow(self, X, cmap=None, norm=None, aspect=None, interpolation=None, alpha=1.0, vmin=None, vmax=None, origin=None, extent=None, shape=None, filternorm=1, @@ -5384,15 +5406,15 @@ def pcolorfast(self, *args, **kwargs): """ + pseudocolor plot of a 2-D array + Experimental; this is a version of pcolor that does not draw lines, that provides the fastest possible rendering with the Agg backend, and that can handle any quadrilateral grid. - pcolor(*args, **kwargs): pseudocolor plot of a 2-D array + Call signatures:: - Function signatures - pcolor(C, **kwargs) pcolor(xr, yr, C, **kwargs) pcolor(x, y, C, **kwargs) @@ -5401,8 +5423,8 @@ C is the 2D array of color values corresponding to quadrilateral cells. Let (nr, nc) be its shape. C may be a masked array. - pcolor(C, **kwargs) is equivalent to - pcolor([0,nc], [0,nr], C, **kwargs) + ``pcolor(C, **kwargs)`` is equivalent to + ``pcolor([0,nc], [0,nr], C, **kwargs)`` xr, yr specify the ranges of x and y corresponding to the rectangular region bounding C. If xr = [x0, x1] and yr = [y0,y1] then @@ -5430,21 +5452,21 @@ and the row index corresponds to y; for details, see the "Grid Orientation" section below. - Optional keyword args are shown with their defaults below (you must - use kwargs for these): + Optional keyword arguments: - * cmap = cm.jet : a cm Colormap instance from cm + cmap: [ None | Colormap ] + A cm Colormap instance from cm. If None, use rc settings. + norm: [ None | Normalize ] + An mcolors.Normalize instance is used to scale luminance data to + 0,1. If None, defaults to normalize() + vmin/vmax: [ None | scalar ] + vmin and vmax are used in conjunction with norm to normalize + luminance data. If either are None, the min and max of the color + array C is used. If you pass a norm instance, vmin and vmax will + be None. + alpha: 0 <= scalar <= 1 + the alpha blending value - * norm = Normalize() : mcolors.Normalize instance - is used to scale luminance data to 0,1. - - * vmin=None and vmax=None : vmin and vmax are used in conjunction - with norm to normalize luminance data. If either are None, the - min and max of the color array C is used. If you pass a norm - instance, vmin and vmax will be None - - * alpha=1.0 : the alpha blending value - Return value is an image if a regular or rectangular grid is specified, and a QuadMesh collection in the general quadrilateral case. @@ -5567,12 +5589,14 @@ def table(self, **kwargs): """ - TABLE(cellText=None, cellColours=None, - cellLoc='right', colWidths=None, - rowLabels=None, rowColours=None, rowLoc='left', - colLabels=None, colColours=None, colLoc='center', - loc='bottom', bbox=None): + call signature:: + table(cellText=None, cellColours=None, + cellLoc='right', colWidths=None, + rowLabels=None, rowColours=None, rowLoc='left', + colLabels=None, colColours=None, colLoc='center', + loc='bottom', bbox=None): + Add a table to the current axes. Returns a table instance. For finer grained control over tables, use the Table class and add it to the axes with add_table. @@ -5587,8 +5611,10 @@ def twinx(self): """ - ax = twinx() + call signature:: + ax = twinx() + create a twin of Axes for generating a plot with a sharex x-axis but independent y axis. The y-axis of self will have ticks on left and the returned axes will have ticks on the @@ -5604,8 +5630,10 @@ def twiny(self): """ - ax = twiny() + call signature:: + ax = twiny() + create a twin of Axes for generating a plot with a shared y-axis but independent x axis. The x-axis of self will have ticks on bottom and the returned axes will have ticks on the @@ -5619,10 +5647,8 @@ self.xaxis.tick_bottom() return ax2 - #### Data analysis - def hist(self, x, bins=10, normed=False, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, **kwargs): @@ -6238,13 +6264,13 @@ fig is a figure instance args is numRows, numCols, plotNum - where the array of subplots in the figure has dimensions - numRows, numCols, and where plotNum is the number of the - subplot being created. plotNum starts at 1 in the upper - right corner and increases to the right. + where the array of subplots in the figure has dimensions + numRows, numCols, and where plotNum is the number of the + subplot being created. plotNum starts at 1 in the upper + right corner and increases to the right. - If numRows<=numCols<=plotNum<10, args can be the decimal - integer numRows*100 + numCols*10 + plotNum. + If numRows<=numCols<=plotNum<10, args can be the decimal + integer numRows*100 + numCols*10 + plotNum. """ self.figure = fig This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |