@@ -2995,27 +2995,24 @@ def plot_date(self, x, y, fmt='bo', tz=None, xdate=True, ydate=False,
29952995
29962996 def loglog (self , * args , ** kwargs ):
29972997 """
2998- LOGLOG(*args, **kwargs)
2999-
3000- Make a loglog plot with log scaling on the a and y axis. The args
3001- to semilog x are the same as the args to plot. See help plot for
3002- more info.
2998+ call signature::
30032999
3004- Optional keyword args supported are any of the kwargs
3005- supported by plot or set_xscale or set_yscale. Notable, for
3006- log scaling:
3000+ loglog(*args, **kwargs)
30073001
3008- * basex: base of the x logarithm
3002+ Make a plot with log scaling on the a and y axis. The args to loglog
3003+ are the same as the args to ``plot``. See ``plot`` for more info.
30093004
3010- * subsx: the location of the minor ticks; None defaults to
3011- autosubs, which depend on the number of decades in the
3012- plot; see set_xscale for details
3005+ loglog supports all the keyword arguments of ``plot`` and
3006+ Axes.set_xscale/Axes.set_yscale.
30133007
3014- * basey: base of the y logarithm
3008+ Notable keyword arguments:
30153009
3016- * subsy: the location of the minor yticks; None defaults to
3010+ basex/basey: scalar > 1
3011+ base of the x/y logarithm
3012+ subsx/subsy: [ None | sequence ]
3013+ the location of the minor x/yticks; None defaults to
30173014 autosubs, which depend on the number of decades in the
3018- plot; see set_yscale for details
3015+ plot; see set_xscale/ set_yscale for details
30193016
30203017 The remaining valid kwargs are Line2D properties:
30213018 %(Line2D)s
@@ -3214,68 +3211,92 @@ def xcorr(self, x, y, normed=False, detrend=mlab.detrend_none, usevlines=False,
32143211
32153212 def legend (self , * args , ** kwargs ):
32163213 """
3217- LEGEND(*args, **kwargs)
3214+ call signature::
3215+
3216+ legend(*args, **kwargs)
32183217
32193218 Place a legend on the current axes at location loc. Labels are a
32203219 sequence of strings and loc can be a string or an integer specifying
32213220 the legend location
32223221
3223- USAGE:
3222+ To make a legend with existing lines::
3223+
3224+ legend()
3225+
3226+ legend by itself will try and build a legend using the label
3227+ property of the lines/patches/collections. You can set the label of
3228+ a line by doing plot(x, y, label='my data') or line.set_label('my
3229+ data'). If label is set to '_nolegend_', the item will not be shown
3230+ in legend.
3231+
3232+ To automatically generate the legend from labels::
3233+
3234+ legend( ('label1', 'label2', 'label3') )
32243235
3225- Make a legend with existing lines
3236+ To make a legend for a list of lines and labels::
32263237
3227- >>> legend()
3238+ legend( (line1, line2, line3), ('label1', 'label2', 'label3') )
32283239
3229- legend by itself will try and build a legend using the label
3230- property of the lines/patches/collections. You can set the label of
3231- a line by doing plot(x, y, label='my data') or line.set_label('my
3232- data'). If label is set to '_nolegend_', the item will not be shown
3233- in legend.
3240+ To make a legend at a given location, using a location argument::
32343241
3235- # automatically generate the legend from labels
3236- legend( ('label1', 'label2', 'label3') )
3242+ legend( ('label1', 'label2', 'label3'), loc='upper left')
32373243
3238- # Make a legend for a list of lines and labels
3239- legend( (line1, line2, line3), ('label1', 'label2', 'label3') )
3244+ or::
32403245
3241- # Make a legend at a given location, using a location argument
3242- # legend( LABELS, LOC ) or
3243- # legend( LINES, LABELS, LOC )
3244- legend( ('label1', 'label2', 'label3'), loc='upper left')
3245- legend( (line1, line2, line3), ('label1', 'label2', 'label3'), loc=2)
3246+ legend( (line1, line2, line3), ('label1', 'label2', 'label3'), loc=2)
32463247
32473248 The location codes are
32483249
3249- 'best' : 0,
3250- 'upper right' : 1,
3251- 'upper left' : 2,
3252- 'lower left' : 3,
3253- 'lower right' : 4,
3254- 'right' : 5,
3255- 'center left' : 6,
3256- 'center right' : 7,
3257- 'lower center' : 8,
3258- 'upper center' : 9,
3259- 'center' : 10,
3260-
3261- If none of these are suitable, loc can be a 2-tuple giving x,y
3262- in axes coords, ie,
3263-
3264- loc = 0, 1 is left top
3265- loc = 0.5, 0.5 is center, center
3266-
3267- and so on. The following kwargs are supported:
3268-
3269- isaxes=True # whether this is an axes legend
3270- numpoints = 4 # the number of points in the legend line
3271- prop = FontProperties(size='smaller') # the font property
3272- pad = 0.2 # the fractional whitespace inside the legend border
3273- markerscale = 0.6 # the relative size of legend markers vs. original
3274- shadow # if True, draw a shadow behind legend
3275- labelsep = 0.005 # the vertical space between the legend entries
3276- handlelen = 0.05 # the length of the legend lines
3277- handletextsep = 0.02 # the space between the legend line and legend text
3278- axespad = 0.02 # the border between the axes and legend edge
3250+ =============== =============
3251+ Location String Location Code
3252+ =============== =============
3253+ 'best' 0
3254+ 'upper right' 1
3255+ 'upper left' 2
3256+ 'lower left' 3
3257+ 'lower right' 4
3258+ 'right' 5
3259+ 'center left' 6
3260+ 'center right' 7
3261+ 'lower center' 8
3262+ 'upper center' 9
3263+ 'center' 10
3264+ =============== =============
3265+
3266+ If none of these are locations are suitable, loc can be a 2-tuple
3267+ giving x,y in axes coords, ie::
3268+
3269+ loc = 0, 1 # left top
3270+ loc = 0.5, 0.5 # center
3271+
3272+ Keyword arguments:
3273+
3274+ isaxes: [ True | False ]
3275+ Indicates that this is an axes legend
3276+ numpoints: integer
3277+ The number of points in the legend line, default is 4
3278+ prop: [ None | FontProperties ]
3279+ A FontProperties instance, or None to use rc settings.
3280+ see :class:`~matplotlib.font_manager.FontProperties`
3281+ pad: [ None | scalar ]
3282+ The fractional whitespace inside the legend border, between 0 and 1.
3283+ If None, use rc settings
3284+ markerscale: [ None | scalar ]
3285+ The relative size of legend markers vs. original. If None, use rc
3286+ settings
3287+ shadow: [ None | False | True ]
3288+ If True, draw a shadow behind legend. If None, use rc settings.
3289+ labelsep: [ None | scalar ]
3290+ The vertical space between the legend entries. If None, use rc
3291+ settings
3292+ handlelen: [ None | scalar ]
3293+ The length of the legend lines. If None, use rc settings.
3294+ handletextsep: [ None | scalar ]
3295+ The space between the legend line and legend text. If None, use rc
3296+ settings.
3297+ axespad: [ None | scalar ]
3298+ The border between the axes and legend edge. If None, use rc
3299+ settings.
32793300 """
32803301
32813302 def get_handles ():
@@ -4863,102 +4884,86 @@ def fill(self, *args, **kwargs):
48634884 #### plotting z(x,y): imshow, pcolor and relatives, contour
48644885
48654886
4866- def imshow (self , X ,
4867- cmap = None ,
4868- norm = None ,
4869- aspect = None ,
4870- interpolation = None ,
4871- alpha = 1.0 ,
4872- vmin = None ,
4873- vmax = None ,
4874- origin = None ,
4875- extent = None ,
4876- shape = None ,
4877- filternorm = 1 ,
4878- filterrad = 4.0 ,
4879- imlim = None ,
4880- ** kwargs ):
4887+ def imshow (self , X , cmap = None , norm = None , aspect = None ,
4888+ interpolation = None , alpha = 1.0 , vmin = None , vmax = None ,
4889+ origin = None , extent = None , shape = None , filternorm = 1 ,
4890+ filterrad = 4.0 , imlim = None , ** kwargs ):
48814891 """
4892+ call signature::
48824893
4883- IMSHOW(X, cmap=None, norm=None, aspect=None, interpolation=None,
4884- alpha=1.0, vmin=None, vmax=None, origin=None, extent=None)
4885-
4886- IMSHOW(X) - plot image X to current axes, resampling to scale to axes
4887- size (X may be numarray/Numeric array or PIL image)
4888-
4889- IMSHOW(X, **kwargs) - Use keyword args to control image scaling,
4890- colormapping etc. See below for details
4891-
4894+ imshow(X, cmap=None, norm=None, aspect=None, interpolation=None,
4895+ alpha=1.0, vmin=None, vmax=None, origin=None, extent=None,
4896+ **kwargs)
48924897
48934898 Display the image in X to current axes. X may be a float array, a
48944899 uint8 array or a PIL image. If X is an array, X can have the following
48954900 shapes:
48964901
4897- MxN : luminance (grayscale, float array only)
4898-
4899- MxNx3 : RGB (float or uint8 array)
4900-
4901- MxNx4 : RGBA (float or uint8 array)
4902+ * MxN -- luminance (grayscale, float array only)
4903+ * MxNx3 -- RGB (float or uint8 array)
4904+ * MxNx4 -- RGBA (float or uint8 array)
49024905
49034906 The value for each component of MxNx3 and MxNx4 float arrays should be
49044907 in the range 0.0 to 1.0; MxN float arrays may be normalised.
49054908
4906- A image.AxesImage instance is returned
4907-
4908- The following kwargs are allowed:
4909-
4910- * cmap is a cm colormap instance, eg cm.jet. If None, default to rc
4911- image.cmap value (Ignored when X has RGB(A) information)
4909+ An image.AxesImage instance is returned.
49124910
4913- * aspect is one of: auto, equal, or a number. If None, default to rc
4914- image.aspect value
4915-
4916- * interpolation is one of:
4911+ Keyword arguments:
49174912
4918- 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36',
4919- 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
4920- 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
4913+ cmap: [ None | Colormap ]
4914+ A cm colormap instance, eg cm.jet. If None, default to rc
4915+ image.cmap value
4916+
4917+ cmap is ignored when X has RGB(A) information
4918+ aspect: [ None | 'auto' | 'equal' | scalar ]
4919+ If 'auto', changes the image aspect ratio to match that of the axes
4920+
4921+ If 'equal', and extent is None, changes the axes aspect ratio to
4922+ match that of the image. If extent is not None, the axes aspect
4923+ ratio is changed to match that of the extent.
4924+
4925+ If None, default to rc image.aspect value.
4926+ interpolation:
4927+ Acceptable values are None, 'nearest', 'bilinear', 'bicubic',
4928+ 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
4929+ 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
49214930 'lanczos', 'blackman'
49224931
4923- if interpolation is None, default to rc
4924- image.interpolation. See also th the filternorm and
4925- filterrad parameters
4926-
4927- * norm is a mcolors.Normalize instance; default is
4928- normalization(). This scales luminance -> 0-1 (only used for an
4929- MxN float array).
4930-
4931- * vmin and vmax are used to scale a luminance image to 0-1. If
4932- either is None, the min and max of the luminance values will be
4933- used. Note if you pass a norm instance, the settings for vmin and
4934- vmax will be ignored.
4935-
4936- * alpha = 1.0 : the alpha blending value
4937-
4938- * origin is 'upper' or 'lower', to place the [0,0]
4939- index of the array in the upper left or lower left corner of
4940- the axes. If None, default to rc image.origin
4941-
4942- * extent is (left, right, bottom, top) data values of the
4943- axes. The default assigns zero-based row, column indices
4944- to the x, y centers of the pixels.
4945-
4946- * shape is for raw buffer images
4947-
4948- * filternorm is a parameter for the antigrain image resize
4949- filter. From the antigrain documentation, if normalize=1,
4950- the filter normalizes integer values and corrects the
4951- rounding errors. It doesn't do anything with the source
4952- floating point values, it corrects only integers according
4953- to the rule of 1.0 which means that any sum of pixel
4954- weights must be equal to 1.0. So, the filter function
4955- must produce a graph of the proper shape.
4956-
4957- * filterrad: the filter radius for filters that have a radius
4958- parameter, ie when interpolation is one of: 'sinc',
4959- 'lanczos' or 'blackman'
4960-
4961- Additional kwargs are martist properties
4932+ If interpolation is None, default to rc image.interpolation. See
4933+ also th the filternorm and filterrad parameters
4934+ norm: [ None | Normalize ]
4935+ An mcolors.Normalize instance; if None, default is normalization().
4936+ This scales luminance -> 0-1
4937+
4938+ norm is only used for an MxN float array.
4939+ vmin/vmax: [ None | scalar ]
4940+ Used to scale a luminance image to 0-1. If either is None, the min
4941+ and max of the luminance values will be used. Note if you pass a
4942+ norm instance, the settings for vmin and vmax will be ignored.
4943+ alpha: scalar
4944+ the alpha blending value, between 0 (transparent) and 1 (opaque)
4945+ origin: [ None | 'upper' | 'lower' ]
4946+ Place the [0,0] index of the array in the upper left or lower left
4947+ corner of the axes. If None, default to rc image.origin
4948+ extent: [ None | scalars (left, right, bottom, top) ]
4949+ data values of the axes. The default assigns zero-based row,
4950+ column indices to the x, y centers of the pixels.
4951+ shape: [ None | scalars (columns, rows) ]
4952+ for raw buffer images
4953+ filternorm:
4954+ A parameter for the antigrain image resize filter. From the
4955+ antigrain documentation, if normalize=1, the filter normalizes
4956+ integer values and corrects the rounding errors. It doesn't do
4957+ anything with the source floating point values, it corrects only
4958+ integers according to the rule of 1.0 which means that any sum of
4959+ pixel weights must be equal to 1.0. So, the filter function must
4960+ produce a graph of the proper shape.
4961+ filterrad:
4962+ the filter radius for filters that have a radius parameter, ie when
4963+ interpolation is one of: 'sinc', 'lanczos' or 'blackman'
4964+
4965+ Additional kwargs are Artist properties:
4966+ %(Artist)s
49624967 """
49634968
49644969 if not self ._hold : self .cla ()
@@ -4992,6 +4997,7 @@ def imshow(self, X,
49924997 self .images .append (im )
49934998
49944999 return im
5000+ imshow .__doc__ = cbook .dedent (imshow .__doc__ ) % martist .kwdocd
49955001
49965002
49975003 def _pcolorargs (self , funcname , * args ):
@@ -6054,7 +6060,7 @@ def spy(self, Z, precision=None, marker=None, markersize=None,
60546060
60556061 def matshow (self , Z , ** kwargs ):
60566062 '''
6057- Plot a matrix as an image.
6063+ Plot a matrix or array as an image.
60586064
60596065 The matrix will be shown the way it would be printed,
60606066 with the first row at the top. Row and column numbering
0 commit comments