PlotAxes¶
- class PlotAxes(*args, **kwargs)[source]¶
Bases:
proplot.axes.base.AxesThe second lowest-level
Axessubclass used by proplot. Implements all plotting overrides.- Parameters
*args, **kwargs – Passed to
Axes.
See also
matplotlib.axes.Axes,proplot.axes.Axes,proplot.axes.CartesianAxes,proplot.axes.PolarAxes,proplot.axes.GeoAxesMethods Summary
area(*args, **kwargs)Plot individual, grouped, or overlaid shading patches.
areax(*args, **kwargs)Plot individual, grouped, or overlaid shading patches.
bar(*args, **kwargs)Plot individual, grouped, or stacked bars.
barbs(x, y, u, v, c, **kwargs)Plot wind barbs.
barh(*args, **kwargs)Plot individual, grouped, or stacked bars.
box(*args, **kwargs)Plot vertical boxes and whiskers with a nice default style.
boxes(*[, new_obj, message])boxh(*args, **kwargs)Plot horizontal boxes and whiskers with a nice default style.
boxplot(*args, **kwargs)Plot vertical boxes and whiskers with a nice default style.
boxploth(*args, **kwargs)Plot horizontal boxes and whiskers with a nice default style.
contour(x, y, z, **kwargs)Plot contour lines.
contourf(x, y, z, **kwargs)Plot filled contours.
fill_between(*args, **kwargs)Plot individual, grouped, or overlaid shading patches.
fill_betweenx(*args, **kwargs)Plot individual, grouped, or overlaid shading patches.
heatmap(*args[, aspect])Plot grid boxes with formatting suitable for heatmaps.
hexbin(x, y, weights, **kwargs)Plot a 2D hexagonally binned histogram.
hist(*args, **kwargs)Plot vertical histograms.
hist2d(x, y, bins, **kwargs)Plot a standard 2D histogram.
histh(*args, **kwargs)Plot horizontal histograms.
hlines(*args, **kwargs)Plot horizontal lines.
imshow(z, **kwargs)Plot an image.
line(*args, **kwargs)Plot standard lines.
linex(*args, **kwargs)Plot standard lines.
matshow(z, **kwargs)Plot a matrix.
parametric(x, y, c, *[, interp, scalex, scaley])Plot a parametric line.
pcolor(x, y, z, **kwargs)Plot irregular grid boxes.
pcolorfast(x, y, z, **kwargs)Plot grid boxes quickly.
pcolormesh(x, y, z, **kwargs)Plot regular grid boxes.
pie(x, explode, *[, labelpad, labeldistance])Plot a pie chart.
plot(*args, **kwargs)Plot standard lines.
plotx(*args, **kwargs)Plot standard lines.
quiver(x, y, u, v, c, **kwargs)Plot quiver arrows.
scatter(*args, **kwargs)Plot markers with flexible keyword arguments.
scatterx(*args, **kwargs)Plot markers with flexible keyword arguments.
set_prop_cycle(*args, **kwargs)Set the property cycle of the Axes.
spy(z, **kwargs)Plot a sparcity pattern.
stem(*args, **kwargs)Plot stem lines.
stemx(*args, **kwargs)Plot stem lines.
step(*args, **kwargs)Plot step lines.
stepx(*args, **kwargs)Plot step lines.
stream(*args, **kwargs)Plot streamlines.
streamplot(x, y, u, v, c, **kwargs)Plot streamlines.
tricontour(x, y, z, **kwargs)Plot contour lines on a triangular grid.
tricontourf(x, y, z, **kwargs)Plot filled contours on a triangular grid.
tripcolor(x, y, z, **kwargs)Plot triangular grid boxes.
violin(*args, **kwargs)Plot vertical violins with a nice default style matching this matplotlib example.
violinh(*args, **kwargs)Plot horizontal violins with a nice default style matching this matplotlib example.
violinplot(*args, **kwargs)Plot vertical violins with a nice default style matching this matplotlib example.
violinploth(*args, **kwargs)Plot horizontal violins with a nice default style matching this matplotlib example.
violins(*[, new_obj, message])vlines(*args, **kwargs)Plot vertical lines.
Methods Documentation
- area(*args, **kwargs)[source]¶
Plot individual, grouped, or overlaid shading patches.
- Parameters
*args (
y2orx,y2, orx,y1,y2) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y2.shape[0]).If only
xandy2coordinates are passed, set they1coordinates to zero. This draws elements originating from the zero line.If both
y1andy2are provided, draw elements between these points. If either are 2D, draw elements by iterating over each column.If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
stack, stacked (
bool, optional) – Whether to “stack” area patches from successive columns of y data or plot area patches on top of each other. Default isFalse.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
where (
ndarray, optional) – A boolean mask for the points that should be shaded. See this matplotlib example.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.negpos (
bool, optional) – Whether to shade patches wherey2 >= y1withposcolorand wherey2 < y1withnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive patches. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
fill_between.
- areax(*args, **kwargs)[source]¶
Plot individual, grouped, or overlaid shading patches.
- Parameters
*args (
x2ory,x2, ory,x1,x2) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x2.shape[0]).If only
yandx2coordinates are passed, set thex1coordinates to zero. This draws elements originating from the zero line.If both
x1andx2are provided, draw elements between these points. If either are 2D, draw elements by iterating over each column.If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
stack, stacked (
bool, optional) – Whether to “stack” area patches from successive columns of x data or plot area patches on top of each other. Default isFalse.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
where (
ndarray, optional) – A boolean mask for the points that should be shaded. See this matplotlib example.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.negpos (
bool, optional) – Whether to shade patches wherey2 >= y1withposcolorand wherey2 < y1withnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive patches. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
fill_betweenx.
- bar(*args, **kwargs)[source]¶
Plot individual, grouped, or stacked bars.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
width (
floator array-like, optional) – The width(s) of the bars relative to the x coordinate step size. Can be passed as a third positional argument.bottom (
floator array-like, optional) – The coordinate(s) of the bottom edge of the bars. Default is0. Can be passed as a fourth positinal argument.absolute_width (
bool, optional) – Whether to make thewidthunits absolute. IfTrue, this restores the default matplotlib behavior. Default isFalse.stack, stacked (
bool, optional) – Whether to “stack” bars from successive columns of y data or plot bars side-by-side in groups. Default isFalse.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.negpos (
bool, optional) – Whether to shade bars whereheight >= 0withposcolorand whereheight < 0withnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive bars. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.mean, means (
bool, optional) – Whether to plot the means of each column for 2Dycoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dycoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
bar.
- barbs(x, y, u, v, c, **kwargs)[source]¶
Plot wind barbs.
- Parameters
*args (
u,vorx,y,u,v) – The data passed as positional or keyword arguments. Interpreted as follows:If only
uandvcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If theuandvcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
c, color, colors (array-like or
color-spec, optional) – The colors of the wind barbs passed as either a keyword argument or a fifth positional argument. This can be a single color or a color array to be scaled bycmapandnorm.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.**kwargs – Passed to
matplotlib.axes.Axes.barbs
- barh(*args, **kwargs)[source]¶
Plot individual, grouped, or stacked bars.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
width (
floator array-like, optional) – The width(s) of the bars relative to the y coordinate step size. Can be passed as a third positional argument.left (
floator array-like, optional) – The coordinate(s) of the left edge of the bars. Default is0. Can be passed as a fourth positinal argument.absolute_width (
bool, optional) – Whether to make thewidthunits absolute. IfTrue, this restores the default matplotlib behavior. Default isFalse.stack, stacked (
bool, optional) – Whether to “stack” bars from successive columns of x data or plot bars side-by-side in groups. Default isFalse.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.negpos (
bool, optional) – Whether to shade bars whereheight >= 0withposcolorand whereheight < 0withnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive bars. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.mean, means (
bool, optional) – Whether to plot the means of each column for 2Dxcoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dxcoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
barh.
- box(*args, **kwargs)[source]¶
Plot vertical boxes and whiskers with a nice default style.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
fill (
bool, optional) – Whether to fill the box with a color. Default isTrue.mean, means (
bool, optional) – IfTrue, this passesshowmeans=Trueandmeanline=Truetoboxplot.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the boxes. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the boxes. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the boxes. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the boxes. Default is1.0.m, marker, ms, markersize (
floatorstr, optional) – Marker style and size for the ‘fliers’, i.e. outliers. Default is determined byrc['boxplot.flierprops'].meanls, medianls, meanlinestyle, medianlinestyle, meanlinestyles, medianlinestyles (
line style-spec, optional) – The line style for the mean and median lines drawn horizontally across the box.boxc, capc, whiskerc, flierc, meanc, medianc, boxcolor, capcolor, whiskercolor, fliercolor, meancolor, mediancolor boxcolors, capcolors, whiskercolors, fliercolors, meancolors, mediancolors (
color-specor sequence, optional) – The color of various boxplot components. If a sequence, should be the same length as the number of boxes. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.boxlw, caplw, whiskerlw, flierlw, meanlw, medianlw, boxlinewidth, caplinewidth, meanlinewidth, medianlinewidth, whiskerlinewidth, flierlinewidth, boxlinewidths, caplinewidths, meanlinewidths, medianlinewidths, whiskerlinewidths, flierlinewidths (
float, optional) – The line width of various boxplot components. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.**kwargs – Passed to
matplotlib.axes.Axes.boxplot.
See also
PlotAxes.boxes,PlotAxes.boxesh,PlotAxes.boxplot,PlotAxes.boxploth,matplotlib.axes.Axes.boxplot
- boxes(*, new_obj=<function PlotAxes.box>, message="'boxes' was deprecated in version 0.8 and will be removed in a future release. Please use 'box' instead.", **kwargs)¶
- boxh(*args, **kwargs)[source]¶
Plot horizontal boxes and whiskers with a nice default style.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
fill (
bool, optional) – Whether to fill the box with a color. Default isTrue.mean, means (
bool, optional) – IfTrue, this passesshowmeans=Trueandmeanline=Truetoboxplot.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the boxes. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the boxes. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the boxes. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the boxes. Default is1.0.m, marker, ms, markersize (
floatorstr, optional) – Marker style and size for the ‘fliers’, i.e. outliers. Default is determined byrc['boxplot.flierprops'].meanls, medianls, meanlinestyle, medianlinestyle, meanlinestyles, medianlinestyles (
line style-spec, optional) – The line style for the mean and median lines drawn horizontally across the box.boxc, capc, whiskerc, flierc, meanc, medianc, boxcolor, capcolor, whiskercolor, fliercolor, meancolor, mediancolor boxcolors, capcolors, whiskercolors, fliercolors, meancolors, mediancolors (
color-specor sequence, optional) – The color of various boxplot components. If a sequence, should be the same length as the number of boxes. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.boxlw, caplw, whiskerlw, flierlw, meanlw, medianlw, boxlinewidth, caplinewidth, meanlinewidth, medianlinewidth, whiskerlinewidth, flierlinewidth, boxlinewidths, caplinewidths, meanlinewidths, medianlinewidths, whiskerlinewidths, flierlinewidths (
float, optional) – The line width of various boxplot components. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.**kwargs – Passed to
matplotlib.axes.Axes.boxplot.
See also
PlotAxes.boxes,PlotAxes.boxesh,PlotAxes.boxplot,PlotAxes.boxploth,matplotlib.axes.Axes.boxplot
- boxplot(*args, **kwargs)[source]¶
Plot vertical boxes and whiskers with a nice default style.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
fill (
bool, optional) – Whether to fill the box with a color. Default isTrue.mean, means (
bool, optional) – IfTrue, this passesshowmeans=Trueandmeanline=Truetoboxplot.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the boxes. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the boxes. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the boxes. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the boxes. Default is1.0.m, marker, ms, markersize (
floatorstr, optional) – Marker style and size for the ‘fliers’, i.e. outliers. Default is determined byrc['boxplot.flierprops'].meanls, medianls, meanlinestyle, medianlinestyle, meanlinestyles, medianlinestyles (
line style-spec, optional) – The line style for the mean and median lines drawn horizontally across the box.boxc, capc, whiskerc, flierc, meanc, medianc, boxcolor, capcolor, whiskercolor, fliercolor, meancolor, mediancolor boxcolors, capcolors, whiskercolors, fliercolors, meancolors, mediancolors (
color-specor sequence, optional) – The color of various boxplot components. If a sequence, should be the same length as the number of boxes. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.boxlw, caplw, whiskerlw, flierlw, meanlw, medianlw, boxlinewidth, caplinewidth, meanlinewidth, medianlinewidth, whiskerlinewidth, flierlinewidth, boxlinewidths, caplinewidths, meanlinewidths, medianlinewidths, whiskerlinewidths, flierlinewidths (
float, optional) – The line width of various boxplot components. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.**kwargs – Passed to
matplotlib.axes.Axes.boxplot.
See also
PlotAxes.boxes,PlotAxes.boxesh,PlotAxes.boxplot,PlotAxes.boxploth,matplotlib.axes.Axes.boxplot
- boxploth(*args, **kwargs)[source]¶
Plot horizontal boxes and whiskers with a nice default style.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
fill (
bool, optional) – Whether to fill the box with a color. Default isTrue.mean, means (
bool, optional) – IfTrue, this passesshowmeans=Trueandmeanline=Truetoboxplot.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the boxes. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the boxes. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the boxes. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the boxes. Default is1.0.m, marker, ms, markersize (
floatorstr, optional) – Marker style and size for the ‘fliers’, i.e. outliers. Default is determined byrc['boxplot.flierprops'].meanls, medianls, meanlinestyle, medianlinestyle, meanlinestyles, medianlinestyles (
line style-spec, optional) – The line style for the mean and median lines drawn horizontally across the box.boxc, capc, whiskerc, flierc, meanc, medianc, boxcolor, capcolor, whiskercolor, fliercolor, meancolor, mediancolor boxcolors, capcolors, whiskercolors, fliercolors, meancolors, mediancolors (
color-specor sequence, optional) – The color of various boxplot components. If a sequence, should be the same length as the number of boxes. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.boxlw, caplw, whiskerlw, flierlw, meanlw, medianlw, boxlinewidth, caplinewidth, meanlinewidth, medianlinewidth, whiskerlinewidth, flierlinewidth, boxlinewidths, caplinewidths, meanlinewidths, medianlinewidths, whiskerlinewidths, flierlinewidths (
float, optional) – The line width of various boxplot components. These are shorthands so you don’t have to pass e.g. aboxpropsdictionary.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.**kwargs – Passed to
matplotlib.axes.Axes.boxplot.
See also
PlotAxes.boxes,PlotAxes.boxesh,PlotAxes.boxplot,PlotAxes.boxploth,matplotlib.axes.Axes.boxplot
- contour(x, y, z, **kwargs)[source]¶
Plot contour lines.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of the contour lines. Forcontourfplots, lines are added between the filled contours.ls, linestyle, linestyles (
str, optional) – The style of the contour lines. Forcontourfplots, lines are added between the filled contours.ec, edgecolor, edgecolors (
color-spec, optional) – The color for the contour lines. Forcontourfplots, lines are added between the filled contours.a, alpha, alpha (
float, optional) – The opacity of the contours.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.contour.
- contourf(x, y, z, **kwargs)[source]¶
Plot filled contours.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of the contour lines. Forcontourfplots, lines are added between the filled contours.ls, linestyle, linestyles (
str, optional) – The style of the contour lines. Forcontourfplots, lines are added between the filled contours.ec, edgecolor, edgecolors (
color-spec, optional) – The color for the contour lines. Forcontourfplots, lines are added between the filled contours.a, alpha, alpha (
float, optional) – The opacity of the contours.edgefix : bool or float, optional Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.contourf.
- fill_between(*args, **kwargs)[source]¶
Plot individual, grouped, or overlaid shading patches.
- Parameters
*args (
y2orx,y2, orx,y1,y2) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y2.shape[0]).If only
xandy2coordinates are passed, set they1coordinates to zero. This draws elements originating from the zero line.If both
y1andy2are provided, draw elements between these points. If either are 2D, draw elements by iterating over each column.If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
stack, stacked (
bool, optional) – Whether to “stack” area patches from successive columns of y data or plot area patches on top of each other. Default isFalse.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
where (
ndarray, optional) – A boolean mask for the points that should be shaded. See this matplotlib example.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.negpos (
bool, optional) – Whether to shade patches wherey2 >= y1withposcolorand wherey2 < y1withnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive patches. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
fill_between.
- fill_betweenx(*args, **kwargs)[source]¶
Plot individual, grouped, or overlaid shading patches.
- Parameters
*args (
x2ory,x2, ory,x1,x2) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x2.shape[0]).If only
yandx2coordinates are passed, set thex1coordinates to zero. This draws elements originating from the zero line.If both
x1andx2are provided, draw elements between these points. If either are 2D, draw elements by iterating over each column.If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
stack, stacked (
bool, optional) – Whether to “stack” area patches from successive columns of x data or plot area patches on top of each other. Default isFalse.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
where (
ndarray, optional) – A boolean mask for the points that should be shaded. See this matplotlib example.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.negpos (
bool, optional) – Whether to shade patches wherey2 >= y1withposcolorand wherey2 < y1withnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive patches. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
fill_betweenx.
- heatmap(*args, aspect=None, **kwargs)[source]¶
Plot grid boxes with formatting suitable for heatmaps. Ensures square grid boxes, adds major ticks to the center of each grid box, disables minor ticks and gridlines, and sets
rc['cmap.discrete']toFalseby default.- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
aspect (
{'equal', 'auto'}orfloat, optional) – Modify the axes aspect ratio. The aspect ratio is of particular relevance for heatmaps since it may lead to non-square grid boxes. This parameter is a shortcut for callingset_aspect. Default isrc['image.aspect']='equal'. The options are as follows:Number: The data aspect ratio.
'equal': A data aspect ratio of 1.'auto': Allows the data aspect ratio to change depending on the layout. In general this results in non-square grid boxes.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of lines between grid boxes.ls, linestyle, linestyles (
str, optional) – The style of lines between grid boxes.ec, edgecolor, edgecolors (
color-spec, optional) – The color for lines between grid boxes.a, alpha, alphas (
float, optional) – The opacity of the grid boxes.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.pcolormesh.
- hexbin(x, y, weights, **kwargs)[source]¶
Plot a 2D hexagonally binned histogram. standard 2D histogram.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
weights (array-like, optional) – The weights associated with each point. If string this can be retrieved from
data(see below).data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
hexbin.
- hist(*args, **kwargs)[source]¶
Plot vertical histograms.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
bins (
intor sequence offloat, optional) – The bin count or exact bin edges.weights (array-like, optional) – The weights associated with each point. If string this can be retrieved from
data(see below).histtype (
{'bar', 'barstacked', 'step', 'stepfilled'}, optional) – The histogram type. Seematplotlib.axes.Axes.histfor details.width, rwidth (
float, optional) – The bar width(s) for bar-type histograms relative to the bin size. Default is0.8for multiple columns of unstacked data and1otherwise.stack, stacked (
bool, optional) – Whether to “stack” successive columns of x data for bar-type histograms or show side-by-side in groups. Setting this toFalseis equivalent tohisttype='bar'and toTrueis equivalent tohisttype='barstacked'.fill, filled (
bool, optional) – Whether to “fill” step-type histograms or just plot the edges. Setting this toFalseis equivalent tohisttype='step'and toTrueis equivalent tohisttype='stepfilled'.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
hist.
See also
- hist2d(x, y, bins, **kwargs)[source]¶
Plot a standard 2D histogram. standard 2D histogram.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
bins (
intor2-tupleofint, or array-like or2-tupleof array-like, optional) – The bin count or exact bin edges for each dimension or both dimensions.weights (array-like, optional) – The weights associated with each point. If string this can be retrieved from
data(see below).data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
hist2d.
- histh(*args, **kwargs)[source]¶
Plot horizontal histograms.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
bins (
intor sequence offloat, optional) – The bin count or exact bin edges.weights (array-like, optional) – The weights associated with each point. If string this can be retrieved from
data(see below).histtype (
{'bar', 'barstacked', 'step', 'stepfilled'}, optional) – The histogram type. Seematplotlib.axes.Axes.histfor details.width, rwidth (
float, optional) – The bar width(s) for bar-type histograms relative to the bin size. Default is0.8for multiple columns of unstacked data and1otherwise.stack, stacked (
bool, optional) – Whether to “stack” successive columns of x data for bar-type histograms or show side-by-side in groups. Setting this toFalseis equivalent tohisttype='bar'and toTrueis equivalent tohisttype='barstacked'.fill, filled (
bool, optional) – Whether to “fill” step-type histograms or just plot the edges. Setting this toFalseis equivalent tohisttype='step'and toTrueis equivalent tohisttype='stepfilled'.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
hist.
See also
- hlines(*args, **kwargs)[source]¶
Plot horizontal lines.
- Parameters
*args (
x2ory,x2, ory,x1,x2) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x2.shape[0]).If only
yandx2coordinates are passed, set thex1coordinates to zero. This draws elements originating from the zero line.If both
x1andx2are provided, draw elements between these points. If either are 2D, draw elements by iterating over each column.If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
stack, stacked (
bool, optional) – Whether to “stack” lines from successive columns of x data or plot lines on top of each other. Default isFalse.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.negpos (
bool, optional) – Whether to shade lines whereymax >= yminwithposcolorand whereymax < yminwithnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive lines. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
hlines.
- imshow(z, **kwargs)[source]¶
Plot an image.
- Parameters
z (array-like) – The data passed as a positional argument or keyword argument.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.imshow.
- line(*args, **kwargs)[source]¶
Plot standard lines.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.mean, means (
bool, optional) – Whether to plot the means of each column for 2Dycoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dycoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.shadestd, shadestds, shadepctile, shadepctiles, shadedata (optional) – As with
barstd,barpctile, andbardata, but using shading to indicate the error range. IfshadestdsisTrue, the default standard deviation range of +/-2 is used. IfshadepctilesisTrue, the default percentile range of 10 to 90 is used.fadestd, fadestds, fadepctile, fadepctiles, fadedata (optional) – As with
shadestd,shadepctile, andshadedata, but for an additional, more faded, secondary shaded region. IffadestdsisTrue, the default standard deviation range of +/-3 is used. IffadepctilesisTrue, the default percentile range of 0 to 100 is used.shadec, shadecolor, fadec, fadecolor (
color-spec, optional) – Colors for the different shaded regions. Default is to inherit the parent color.shadez, shadezorder, fadez, fadezorder (
float, optional) – The “zorder” for the different shaded regions. Default is1.5.shadea, shadealpha, fadea, fadealpha (
float, optional) – The opacity for the different shaded regions. Defaults are0.4and0.2.shadelw, shadelinewidth, fadelw, fadelinewidth (
float, optional) – The edge line width for the shading patches. Default isrc['patch.linewidth']=0.6.shdeec, shadeedgecolor, fadeec, fadeedgecolor (
float, optional) – The edge color for the shading patches. Default is'none'.shadelabel, fadelabel (
boolorstr, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g.shadelabel=True. To apply a custom label, use e.g.shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
plot.
See also
- linex(*args, **kwargs)[source]¶
Plot standard lines.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.mean, means (
bool, optional) – Whether to plot the means of each column for 2Dxcoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dxcoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.shadestd, shadestds, shadepctile, shadepctiles, shadedata (optional) – As with
barstd,barpctile, andbardata, but using shading to indicate the error range. IfshadestdsisTrue, the default standard deviation range of +/-2 is used. IfshadepctilesisTrue, the default percentile range of 10 to 90 is used.fadestd, fadestds, fadepctile, fadepctiles, fadedata (optional) – As with
shadestd,shadepctile, andshadedata, but for an additional, more faded, secondary shaded region. IffadestdsisTrue, the default standard deviation range of +/-3 is used. IffadepctilesisTrue, the default percentile range of 0 to 100 is used.shadec, shadecolor, fadec, fadecolor (
color-spec, optional) – Colors for the different shaded regions. Default is to inherit the parent color.shadez, shadezorder, fadez, fadezorder (
float, optional) – The “zorder” for the different shaded regions. Default is1.5.shadea, shadealpha, fadea, fadealpha (
float, optional) – The opacity for the different shaded regions. Defaults are0.4and0.2.shadelw, shadelinewidth, fadelw, fadelinewidth (
float, optional) – The edge line width for the shading patches. Default isrc['patch.linewidth']=0.6.shdeec, shadeedgecolor, fadeec, fadeedgecolor (
float, optional) – The edge color for the shading patches. Default is'none'.shadelabel, fadelabel (
boolorstr, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g.shadelabel=True. To apply a custom label, use e.g.shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
plot.
See also
- matshow(z, **kwargs)[source]¶
Plot a matrix.
- Parameters
z (array-like) – The data passed as a positional argument or keyword argument.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.matshow.
- parametric(x, y, c, *, interp=0, scalex=True, scaley=True, **kwargs)[source]¶
Plot a parametric line.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
c, color, colors, values (array-like, optional) – The parametric coordinate. These can be passed as a third positional argument or as a keyword argument. They can also be string labels instead of numbers and the resulting colorbar ticks will be labeled accordingly.
interp (
int, optional) – Interpolate to this many additional points between the parametric coordinates. Default is0. This can be increased to make the color gradations between a small number of coordinates appear “smooth”.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].scalex, scaley (
bool, optional) – Whether the view limits are adapted to the data limits. The values are passed on toautoscale_view.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Valid
LineCollectionproperties.
- Returns
LineCollection– The parametric line. See this matplotlib example.
- pcolor(x, y, z, **kwargs)[source]¶
Plot irregular grid boxes.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of lines between grid boxes.ls, linestyle, linestyles (
str, optional) – The style of lines between grid boxes.ec, edgecolor, edgecolors (
color-spec, optional) – The color for lines between grid boxes.a, alpha, alphas (
float, optional) – The opacity of the grid boxes.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.pcolor.
- pcolorfast(x, y, z, **kwargs)[source]¶
Plot grid boxes quickly.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of lines between grid boxes.ls, linestyle, linestyles (
str, optional) – The style of lines between grid boxes.ec, edgecolor, edgecolors (
color-spec, optional) – The color for lines between grid boxes.a, alpha, alphas (
float, optional) – The opacity of the grid boxes.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.pcolorfast.
- pcolormesh(x, y, z, **kwargs)[source]¶
Plot regular grid boxes.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of lines between grid boxes.ls, linestyle, linestyles (
str, optional) – The style of lines between grid boxes.ec, edgecolor, edgecolors (
color-spec, optional) – The color for lines between grid boxes.a, alpha, alphas (
float, optional) – The opacity of the grid boxes.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.pcolormesh.
- pie(x, explode, *, labelpad=None, labeldistance=None, **kwargs)[source]¶
Plot a pie chart.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the patches.ls, linestyle, linestyles (
str, optional) – The edge style for the patches.ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the patches.fc, facecolor, facecolors, fillcolor, fillcolors (
color-spec, optional) – The face color for the patches.a, alpha, alphas (
float, optional) – The face opacity for the patches.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.labelpad, labeldistance (
float, optional) – The distance at which labels are drawn in radial coordinates.
See also
- plot(*args, **kwargs)[source]¶
Plot standard lines.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.mean, means (
bool, optional) – Whether to plot the means of each column for 2Dycoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dycoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.shadestd, shadestds, shadepctile, shadepctiles, shadedata (optional) – As with
barstd,barpctile, andbardata, but using shading to indicate the error range. IfshadestdsisTrue, the default standard deviation range of +/-2 is used. IfshadepctilesisTrue, the default percentile range of 10 to 90 is used.fadestd, fadestds, fadepctile, fadepctiles, fadedata (optional) – As with
shadestd,shadepctile, andshadedata, but for an additional, more faded, secondary shaded region. IffadestdsisTrue, the default standard deviation range of +/-3 is used. IffadepctilesisTrue, the default percentile range of 0 to 100 is used.shadec, shadecolor, fadec, fadecolor (
color-spec, optional) – Colors for the different shaded regions. Default is to inherit the parent color.shadez, shadezorder, fadez, fadezorder (
float, optional) – The “zorder” for the different shaded regions. Default is1.5.shadea, shadealpha, fadea, fadealpha (
float, optional) – The opacity for the different shaded regions. Defaults are0.4and0.2.shadelw, shadelinewidth, fadelw, fadelinewidth (
float, optional) – The edge line width for the shading patches. Default isrc['patch.linewidth']=0.6.shdeec, shadeedgecolor, fadeec, fadeedgecolor (
float, optional) – The edge color for the shading patches. Default is'none'.shadelabel, fadelabel (
boolorstr, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g.shadelabel=True. To apply a custom label, use e.g.shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
plot.
See also
- plotx(*args, **kwargs)[source]¶
Plot standard lines.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.mean, means (
bool, optional) – Whether to plot the means of each column for 2Dxcoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dxcoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.shadestd, shadestds, shadepctile, shadepctiles, shadedata (optional) – As with
barstd,barpctile, andbardata, but using shading to indicate the error range. IfshadestdsisTrue, the default standard deviation range of +/-2 is used. IfshadepctilesisTrue, the default percentile range of 10 to 90 is used.fadestd, fadestds, fadepctile, fadepctiles, fadedata (optional) – As with
shadestd,shadepctile, andshadedata, but for an additional, more faded, secondary shaded region. IffadestdsisTrue, the default standard deviation range of +/-3 is used. IffadepctilesisTrue, the default percentile range of 0 to 100 is used.shadec, shadecolor, fadec, fadecolor (
color-spec, optional) – Colors for the different shaded regions. Default is to inherit the parent color.shadez, shadezorder, fadez, fadezorder (
float, optional) – The “zorder” for the different shaded regions. Default is1.5.shadea, shadealpha, fadea, fadealpha (
float, optional) – The opacity for the different shaded regions. Defaults are0.4and0.2.shadelw, shadelinewidth, fadelw, fadelinewidth (
float, optional) – The edge line width for the shading patches. Default isrc['patch.linewidth']=0.6.shdeec, shadeedgecolor, fadeec, fadeedgecolor (
float, optional) – The edge color for the shading patches. Default is'none'.shadelabel, fadelabel (
boolorstr, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g.shadelabel=True. To apply a custom label, use e.g.shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
plot.
See also
- quiver(x, y, u, v, c, **kwargs)[source]¶
Plot quiver arrows.
- Parameters
*args (
u,vorx,y,u,v) – The data passed as positional or keyword arguments. Interpreted as follows:If only
uandvcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If theuandvcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
c, color, colors (array-like or
color-spec, optional) – The colors of the quiver arrows passed as either a keyword argument or a fifth positional argument. This can be a single color or a color array to be scaled bycmapandnorm.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.**kwargs – Passed to
matplotlib.axes.Axes.quiver
- scatter(*args, **kwargs)[source]¶
Plot markers with flexible keyword arguments.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
s, size, ms, markersize (
floator sequence offloat, optional) – The marker size(s). If this is an array matching the shape ofxandy, the units are scaled bysminandsmax.c, color, colors, mc, markercolor, markercolors, fc, facecolor, facecolors (array-like or
color-spec, optional) – The marker color(s). If this is an array matching the shape ofxandy, the colors are generated usingcmap,norm,vmin, andvmax.smin, smax (
float, optional) – The minimum and maximum marker size in unitspoints**2used to scales. If not provided, the marker sizes are equivalent to the values ins.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths, mew, markeredgewidth, markeredgewidths (
floator sequence, optional) – The marker edge width(s).edgecolors, markeredgecolor, markeredgecolors (
color-specor sequence, optional) – The marker edge color(s).mean, means (
bool, optional) – Whether to plot the means of each column for 2Dycoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dycoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.shadestd, shadestds, shadepctile, shadepctiles, shadedata (optional) – As with
barstd,barpctile, andbardata, but using shading to indicate the error range. IfshadestdsisTrue, the default standard deviation range of +/-2 is used. IfshadepctilesisTrue, the default percentile range of 10 to 90 is used.fadestd, fadestds, fadepctile, fadepctiles, fadedata (optional) – As with
shadestd,shadepctile, andshadedata, but for an additional, more faded, secondary shaded region. IffadestdsisTrue, the default standard deviation range of +/-3 is used. IffadepctilesisTrue, the default percentile range of 0 to 100 is used.shadec, shadecolor, fadec, fadecolor (
color-spec, optional) – Colors for the different shaded regions. Default is to inherit the parent color.shadez, shadezorder, fadez, fadezorder (
float, optional) – The “zorder” for the different shaded regions. Default is1.5.shadea, shadealpha, fadea, fadealpha (
float, optional) – The opacity for the different shaded regions. Defaults are0.4and0.2.shadelw, shadelinewidth, fadelw, fadelinewidth (
float, optional) – The edge line width for the shading patches. Default isrc['patch.linewidth']=0.6.shdeec, shadeedgecolor, fadeec, fadeedgecolor (
float, optional) – The edge color for the shading patches. Default is'none'.shadelabel, fadelabel (
boolorstr, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g.shadelabel=True. To apply a custom label, use e.g.shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
scatter.
- scatterx(*args, **kwargs)[source]¶
Plot markers with flexible keyword arguments.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
s, size, ms, markersize (
floator sequence offloat, optional) – The marker size(s). If this is an array matching the shape ofxandy, the units are scaled bysminandsmax.c, color, colors, mc, markercolor, markercolors, fc, facecolor, facecolors (array-like or
color-spec, optional) – The marker color(s). If this is an array matching the shape ofxandy, the colors are generated usingcmap,norm,vmin, andvmax.smin, smax (
float, optional) – The minimum and maximum marker size in unitspoints**2used to scales. If not provided, the marker sizes are equivalent to the values ins.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths, mew, markeredgewidth, markeredgewidths (
floator sequence, optional) – The marker edge width(s).edgecolors, markeredgecolor, markeredgecolors (
color-specor sequence, optional) – The marker edge color(s).mean, means (
bool, optional) – Whether to plot the means of each column for 2Dxcoordinates. Means are calculated withnumpy.nanmean. If no other arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).median, medians (
bool, optional) – Whether to plot the medians of each column for 2Dxcoordinates. Medians are calculated withnumpy.nanmedian. If no other arguments arguments are specified, this also setsbarstd=True(andboxstd=Truefor violin plots).barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.shadestd, shadestds, shadepctile, shadepctiles, shadedata (optional) – As with
barstd,barpctile, andbardata, but using shading to indicate the error range. IfshadestdsisTrue, the default standard deviation range of +/-2 is used. IfshadepctilesisTrue, the default percentile range of 10 to 90 is used.fadestd, fadestds, fadepctile, fadepctiles, fadedata (optional) – As with
shadestd,shadepctile, andshadedata, but for an additional, more faded, secondary shaded region. IffadestdsisTrue, the default standard deviation range of +/-3 is used. IffadepctilesisTrue, the default percentile range of 0 to 100 is used.shadec, shadecolor, fadec, fadecolor (
color-spec, optional) – Colors for the different shaded regions. Default is to inherit the parent color.shadez, shadezorder, fadez, fadezorder (
float, optional) – The “zorder” for the different shaded regions. Default is1.5.shadea, shadealpha, fadea, fadealpha (
float, optional) – The opacity for the different shaded regions. Defaults are0.4and0.2.shadelw, shadelinewidth, fadelw, fadelinewidth (
float, optional) – The edge line width for the shading patches. Default isrc['patch.linewidth']=0.6.shdeec, shadeedgecolor, fadeec, fadeedgecolor (
float, optional) – The edge color for the shading patches. Default is'none'.shadelabel, fadelabel (
boolorstr, optional) – Labels for the shaded regions to be used as separate legend entries. To toggle labels “on” and apply a default label, use e.g.shadelabel=True. To apply a custom label, use e.g.shadelabel='label'. Otherwise, the shading is drawn underneath the line and/or marker in the legend entry.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
scatter.
- set_prop_cycle(*args, **kwargs)[source]¶
Set the property cycle of the Axes.
The property cycle controls the style properties such as color, marker and linestyle of future plot commands. The style properties of data already added to the Axes are not modified.
Call signatures:
set_prop_cycle(cycler) set_prop_cycle(label=values[, label2=values2[, ...]]) set_prop_cycle(label, values)
Form 1 sets given
Cyclerobject.Form 2 creates a
Cyclerwhich cycles over one or more properties simultaneously and set it as the property cycle of the axes. If multiple properties are given, their value lists must have the same length. This is just a shortcut for explicitly creating a cycler and passing it to the function, i.e. it’s short forset_prop_cycle(cycler(label=values label2=values2, ...)).Form 3 creates a
Cyclerfor a single property and set it as the property cycle of the axes. This form exists for compatibility with the originalcycler.cyclerinterface. Its use is discouraged in favor of the kwarg form, i.e.set_prop_cycle(label=values).- Parameters
cycler (
Cycler) – Set the given Cycler. None resets to the cycle defined by the current style.label (
str) – The property key. Must be a validArtistproperty. For example, ‘color’ or ‘linestyle’. Aliases are allowed, such as ‘c’ for ‘color’ and ‘lw’ for ‘linewidth’.values (
iterable) – Finite-length iterable of the property values. These values are validated and will raise a ValueError if invalid.
Examples
Setting the property cycle for a single property:
>>> ax.set_prop_cycle(color=['red', 'green', 'blue'])
Setting the property cycle for simultaneously cycling over multiple properties (e.g. red circle, green plus, blue cross):
>>> ax.set_prop_cycle(color=['red', 'green', 'blue'], ... marker=['o', '+', 'x'])
See also
matplotlib.rcsetup.cyclerConvenience function for creating validated cyclers for properties.
cycler.cyclerThe original function for creating unvalidated cyclers.
- spy(z, **kwargs)[source]¶
Plot a sparcity pattern.
- Parameters
z (array-like) – The data passed as a positional argument or keyword argument.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.spy.
- stem(*args, **kwargs)[source]¶
Plot stem lines.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
stem.
- stemx(*args, **kwargs)[source]¶
Plot stem lines.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
stem.
- step(*args, **kwargs)[source]¶
Plot step lines.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
step.
See also
- stepx(*args, **kwargs)[source]¶
Plot step lines.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
step.
See also
- stream(*args, **kwargs)[source]¶
Plot streamlines.
- Parameters
*args (
u,vorx,y,u,v) – The data passed as positional or keyword arguments. Interpreted as follows:If only
uandvcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If theuandvcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
c, color, colors (array-like or
color-spec, optional) – The colors of the streamlines passed as either a keyword argument or a fifth positional argument. This can be a single color or a color array to be scaled bycmapandnorm.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.**kwargs – Passed to
matplotlib.axes.Axes.streamplot
- streamplot(x, y, u, v, c, **kwargs)[source]¶
Plot streamlines.
- Parameters
*args (
u,vorx,y,u,v) – The data passed as positional or keyword arguments. Interpreted as follows:If only
uandvcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If theuandvcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
c, color, colors (array-like or
color-spec, optional) – The colors of the streamlines passed as either a keyword argument or a fifth positional argument. This can be a single color or a color array to be scaled bycmapandnorm.data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.**kwargs – Passed to
matplotlib.axes.Axes.streamplot
- tricontour(x, y, z, **kwargs)[source]¶
Plot contour lines on a triangular grid.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of the contour lines. Forcontourfplots, lines are added between the filled contours.ls, linestyle, linestyles (
str, optional) – The style of the contour lines. Forcontourfplots, lines are added between the filled contours.ec, edgecolor, edgecolors (
color-spec, optional) – The color for the contour lines. Forcontourfplots, lines are added between the filled contours.a, alpha, alpha (
float, optional) – The opacity of the contours.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.tricontour.
- tricontourf(x, y, z, **kwargs)[source]¶
Plot filled contours on a triangular grid.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of the contour lines. Forcontourfplots, lines are added between the filled contours.ls, linestyle, linestyles (
str, optional) – The style of the contour lines. Forcontourfplots, lines are added between the filled contours.ec, edgecolor, edgecolors (
color-spec, optional) – The color for the contour lines. Forcontourfplots, lines are added between the filled contours.a, alpha, alpha (
float, optional) – The opacity of the contours.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.tricontourf.
- tripcolor(x, y, z, **kwargs)[source]¶
Plot triangular grid boxes.
- Parameters
*args (
zorx,y,z) – The data passed as positional or keyword arguments. Interpreted as follows:If only
zcoordinates are passed, try to infer thexandycoordinates from theDataFrameindices and columns or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, y.shape[0])and thexcoordinates arenp.arange(0, y.shape[1]).For
pcolorandpcolormesh, calculate coordinate edges usingedgesoredges2dif centers were provided. For all other methods, calculate coordinate centers if edges were provided.If the
xorycoordinates arepint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. If thezcoordinates arepint.Quantity, pass the magnitude to the plotting command. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.transpose (
bool, optional) – Whether to transpose the input data. This should be used when passing datasets with column-major dimension order(x, y). Otherwise row-major dimension order(y, x)is expected.order (
{{'C', 'F'}}, optional) – Alternative totranspose.'C'corresponds to the default C-cyle row-major ordering (equivalent totranspose=False).'F'corresponds to Fortran-style column-major ordering (equivalent totranspose=True).globe (
bool, optional) – Forproplot.axes.GeoAxesonly. Whether to enforce global coverage. Default isFalse. When set toTruethis does the following:Interpolates input data to the North and South poles by setting the data values at the poles to the mean from latitudes nearest each pole.
Makes meridional coverage “circular”, i.e. the last longitude coordinate equals the first longitude coordinate plus 360°.
When basemap is the backend, cycles 1D longitude vectors to fit within the map edges. For example, if the central longitude is 90°, the data is shifted so that it spans -90° to 270°.
- Other Parameters
cmap (
colormap-spec, optional) – The colormap specifer, passed to theColormapconstructor function.c, color, colors (
color-specor sequence ofcolor-spec, optional) – The color(s) used to create aDiscreteColormap. If not passed,cmapis used.norm (
norm-spec, optional) – The continuous colormap normalizer, passed to theNormconstructor function. IfdiscreteisTruethis is also used to normalize values passed toDiscreteNormbefore colors is selected.discrete (
bool, optional) – IfFalse, thenDiscreteNormis not applied to the colormap. Instead, for non-contour plots, the number of levels will be roughly controlled byrc['cmap.lut']. This has a similar effect to usinglevels=large_numberbut it may improve rendering speed. Default isFalseforimshow,matshow,spy,hexbin,hist2d, andheatmapplots, butTrueotherwise.sequential, diverging, cyclic, qualitative (
bool, optional) – Boolean arguments used ifcmapis not passed. Set these toTrueto use the defaultrc['cmap.sequential'],rc['cmap.diverging'],rc['cmap.cyclic'], andrc['cmap.qualitative']colormaps. Thedivergingoption also appliesDivergingNormas the default continuous normalizer.extend (
{{'neither', 'min', 'max', 'both'}}, optional) – Whether to assign unique colors to out-of-bounds data and draw colorbar “extensions” when a colorbar is drawn.N – Shorthand for
levels.levels (
intor sequence offloat, optional) – The number of level edges or a sequence of level edges. If the former,locatoris used to generate this many level edges at “nice” intervals. If the latter, the levels should be monotonically increasing or decreasing (note that decreasing levels will only work withpcolorplots, notcontourplots). Default isrc['cmap.levels']=11.values (
intor sequence offloat, optional) – The number of level centers or a sequence of level centers. If the former,locatoris used to generate this many level centers at “nice” intervals. If the latter, levels are inferred usingedges. This will override anylevelsinput.vmin, vmax (
float, optional) – Used to determine level locations iflevelsorvaluesis an integer. Actual levels may not fall exactly onvminandvmax, but the minimum level will be no smaller thanvminand the maximum level will be no larger thanvmax. Ifvminorvmaxare not provided, the minimum and maximum data values are used.robust (
bool,float, or2-tuple, optional) – IfTrueandvminorvmaxwere not provided, they are determined from the 2nd and 98th data percentiles rather than the minimum and maximum. If float, this percentile range is used (for example,90corresponds to the 5th to 95th percentiles). If 2-tuple of float, these specific percentiles should be used. This feature is useful when your data has large outliers. Default isrc['cmap.robust']=False.inbounds (
bool, optional) – IfTrueandvminorvmaxwere not provided, when axis limits have been explicitly restricted withset_xlimorset_ylim, out-of-bounds data is ignored. Default isrc['cmap.inbounds']=True. See alsorc['axes.inbounds'].locator (
locator-spec, optional) – The locator used to determine level locations iflevelsorvaluesis an integer. Passed to theLocatorconstructor. Default isMaxNLocatorwithlevelsinteger levels.symmetric (
bool, optional) – IfTrue, automatically generated levels are symmetric about zero. Default is alwaysFalse.positive (
bool, optional) – IfTrue, automatically generated levels are positive with a minimum at zero. Default is alwaysFalse.negative (
bool, optional) – IfTrue, automatically generated levels are negative with a maximum at zero. Default is alwaysFalse.nozero (
bool, optional) – IfTrue,0is removed from the level list. This is mainly useful for single-colorcontourplots.lw, linewidth, linewidths (
float, optional) – The width of lines between grid boxes.ls, linestyle, linestyles (
str, optional) – The style of lines between grid boxes.ec, edgecolor, edgecolors (
color-spec, optional) – The color for lines between grid boxes.a, alpha, alphas (
float, optional) – The opacity of the grid boxes.edgefix (
boolorfloat, optional) – Whether to fix the common issue where white lines appear between adjacent patches in saved vector graphics. This can slow down figure rendering. Default isrc.edgefix=True. IfTrue, a small default linewidth is used to cover up the white lines. If float, this linewidth is used.labels (
bool, optional) – Whether to apply labels to contours and grid boxes. The text will be white when the luminance of the underlying filled contour or grid box is less than 50 and black otherwise.labels_kw (dict-like, optional) – Ignored if
labelsisFalse. Extra keyword args for the labels. For contour plots, this is passed toclabel. Otherwise, this is passed totext.fmt (
format-spec, optional) – Passed to theNormconstructor, used to format number labels. You can also use theprecisionkeyword arg.precision (
int, optional) – Maximum number of decimal places for the number labels. Number labels are generated with theSimpleFormatterformatter, which permits limiting the precision.label (
str, optional) – The legend label to be used for this object. In the case of contours, this is paired with the the central artist in the artist list returned bymatplotlib.contour.ContourSet.legend_elements.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
matplotlib.axes.Axes.tripcolor.
- violin(*args, **kwargs)[source]¶
Plot vertical violins with a nice default style matching this matplotlib example.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the violins. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the violins. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the violins. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the violins. Default is1.0.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.**kwargs – Passed to
matplotlib.axes.Axes.violinplot.
Note
It is no longer possible to show minima and maxima with whiskers – while this is useful for
boxplots it is redundant forviolinplots.See also
PlotAxes.violins,PlotAxes.violinsh,PlotAxes.violinplot,PlotAxes.violinploth,matplotlib.axes.Axes.violinplot
- violinh(*args, **kwargs)[source]¶
Plot horizontal violins with a nice default style matching this matplotlib example.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the violins. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the violins. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the violins. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the violins. Default is1.0.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.**kwargs – Passed to
matplotlib.axes.Axes.violinplot.
Note
It is no longer possible to show minima and maxima with whiskers – while this is useful for
boxplots it is redundant forviolinplots.See also
PlotAxes.violins,PlotAxes.violinsh,PlotAxes.violinplot,PlotAxes.violinploth,matplotlib.axes.Axes.violinplot
- violinplot(*args, **kwargs)[source]¶
Plot vertical violins with a nice default style matching this matplotlib example.
- Parameters
*args (
yorx,y) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y.shape[0]).If the
ycoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the violins. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the violins. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the violins. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the violins. Default is1.0.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.**kwargs – Passed to
matplotlib.axes.Axes.violinplot.
Note
It is no longer possible to show minima and maxima with whiskers – while this is useful for
boxplots it is redundant forviolinplots.See also
PlotAxes.violins,PlotAxes.violinsh,PlotAxes.violinplot,PlotAxes.violinploth,matplotlib.axes.Axes.violinplot
- violinploth(*args, **kwargs)[source]¶
Plot horizontal violins with a nice default style matching this matplotlib example.
- Parameters
*args (
xory,x) – The data passed as positional or keyword arguments. Interpreted as follows:If only
xcoordinates are passed, try to infer theycoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, theycoordinates arenp.arange(0, x.shape[0]).If the
xcoordinates are a 2D array, plot each column of data in succession (except where each column of data represents a statistical distribution, as withboxplot,violinplot, or when usingmeans=Trueormedians=True).If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The edge width for the violins. Default isrc['patch.linewidth']=0.6.c, color, colors, ec, edgecolor, edgecolors (
color-spec, optional) – The edge color for the violins. Default is'black'.fc, facecolor, fillcolor, facecolors, fillcolors (
color-spec, optional) – The fill color for the violins. Default is to use the propertycycle.a, alpha, alphas (
float, optional) – The opacity of the violins. Default is1.0.label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.barstd, barstds (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. Standard deviation multiples for thin error bars with optional whiskers (i.e., caps). If scalar, then +/- that multiple is used. IfTrue, the default standard deviation range of +/-3 is used.barpctile, barpctiles (
bool,float, or2-tupleoffloat, optional) – Valid only ifmeanormedianisTrue. As withbarstd, but instead using percentiles for the error bars. If scalar, that percentile range is used (e.g.,90shows the 5th to 95th percentiles). IfTrue, the default percentile range of 0 to 100 is used.bardata (array-like, optional) – Valid only if
meanandmedianareFalse. If shape is 2 x N, these are the lower and upper bounds for the thin error bars. If shape is N, these are the absolute, symmetric deviations from the central points.boxstd, boxstds, boxpctile, boxpctiles, boxdata (optional) – As with
barstd,barpctile, andbardata, but for thicker error bars representing a smaller interval than the thin error bars. IfboxstdsisTrue, the default standard deviation range of +/-1 is used. IfboxpctilesisTrue, the default percentile range of 25 to 75 is used (i.e., the interquartile range). When “boxes” and “bars” are combined, this has the effect of drawing miniature box-and-whisker plots.capsize (
float, optional) – The cap size for thin error bars in points. Default isrc['errorbar.capsize']=3.0.barz, barzorder, boxz, boxzorder (
float, optional) – The “zorder” for the thin and thick error bars. Default is2.5.barc, barcolor, boxc, boxcolor (
color-spec, optional) – Colors for the thin and thick error bars. Default isrc['boxplot.whiskerprops.color']='black'.barlw, barlinewidth, boxlw, boxlinewidth (
float, optional) – Line widths for the thin and thick error bars, in points. The defaultsrc['boxplot.whiskerprops.linewidth']=1.0(bars) and four times that value (boxes).boxm, boxmarker (
boolormarker-spec, optional) – Whether to draw a small marker in the middle of the box denoting the mean or median position. Ignored ifboxesisFalse. Default is'o'.boxms, boxmarkersize (
size-spec, optional) – The marker size for theboxmarkermarker in points ** 2. Default size is equal to(2 * boxlinewidth) ** 2.boxmc, boxmarkercolor, boxmec, boxmarkeredgecolor (
color-spec, optional) – Color, face color, and edge color for theboxmarkermarker. Default color and edge color are'w'.**kwargs – Passed to
matplotlib.axes.Axes.violinplot.
Note
It is no longer possible to show minima and maxima with whiskers – while this is useful for
boxplots it is redundant forviolinplots.See also
PlotAxes.violins,PlotAxes.violinsh,PlotAxes.violinplot,PlotAxes.violinploth,matplotlib.axes.Axes.violinplot
- violins(*, new_obj=<function PlotAxes.violin>, message="'violins' was deprecated in version 0.8 and will be removed in a future release. Please use 'violin' instead.", **kwargs)¶
- vlines(*args, **kwargs)[source]¶
Plot vertical lines.
- Parameters
*args (
y2orx,y2, orx,y1,y2) – The data passed as positional or keyword arguments. Interpreted as follows:If only
ycoordinates are passed, try to infer thexcoordinates from theSeriesorDataFrameindices or theDataArraycoordinates. Otherwise, thexcoordinates arenp.arange(0, y2.shape[0]).If only
xandy2coordinates are passed, set they1coordinates to zero. This draws elements originating from the zero line.If both
y1andy2are provided, draw elements between these points. If either are 2D, draw elements by iterating over each column.If any arguments are
pint.Quantity, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib. Apint.Quantityembedded in anxarray.DataArrayis also supported.
data (dict-like, optional) – A dict-like dataset container (e.g.,
DataFrameorDataArray). If passed, positional arguments can optionally be stringdatakeys and the arrays used for plotting are retrieved withdata[key]. This is a native matplotlib feature.autoformat (
bool, optional) – Whether thexaxis labels,yaxis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries,DataFrame,DataArray, orQuantityis passed to the plotting command. Default isrc.autoformat=True.
- Other Parameters
stack, stacked (
bool, optional) – Whether to “stack” lines from successive columns of y data or plot lines on top of each other. Default isFalse.cycle (
cycle-spec, optional) – The cycle specifer, passed to theCycleconstructor. If the returned cycler is unchanged from the current cycler, the axes cycler will not be reset to its first position. To disable property cycling and just use black for the default color, usecycle=False,cycle='none', orcycle=()(analogous to disabling ticks with e.g.xformatter='none'). To restore the default property cycler, usecycle=True.lw, linewidth, linewidths (
float, optional) – The line width.ls, linestyle, linestyles (
str, optional) – The line style.c, color, colors (
color-spec, optional) – The line color.a, alpha, alphas (
float, optional) – The opacity.negpos (
bool, optional) – Whether to shade lines whereymax >= yminwithposcolorand whereymax < yminwithnegcolor. Default isFalse. IfTruethis function will return a 2-tuple of values.negcolor, poscolor (
color-spec, optional) – Colors to use for the negative and positive lines. Ignored ifnegposisFalse. Defaults arerc.negcolor='blue7'andrc.poscolor='red7'.inbounds (
bool, optional) – Whether to restrict the defaulty(x) axis limits to account for only in-bounds data when thex(y) axis limits have been locked. Default isrc['axes.inbounds']=True. See alsorc['cmap.inbounds'].label, value (
floatorstr, optional) – The single legend label or colorbar coordinate to be used for this plotted element. This is generally used with 1D input coordinates.labels, values (sequence of
floator sequence ofstr, optional) – The legend labels or colorbar coordinates used for each plotted element. Can be numeric or string, and must match the number of plotted elements. This is generally used with 2D input coordinates.colorbar (
bool,int, orstr, optional) – If notNone, this is a location specifying where to draw an inner or outer colorbar from the resulting object(s). IfTrue, the defaultrc['colorbar.loc']='right'is used. If the same location is used in successive plotting calls, object(s) will be added to the existing colorbar in that location (valid for colorbars built from lists of artists). Valid locations are shown in incolorbar.colorbar_kw (dict-like, optional) – Extra keyword args for the call to
colorbar.legend (
bool,int, orstr, optional) – Location specifying where to draw an inner or outer legend from the resulting object(s). IfTrue, the defaultrc['legend.loc']='best'is used. If the same location is used in successive plotting calls, object(s) will be added to existing legend in that location. Valid locations are shown inlegend.legend_kw (dict-like, optional) – Extra keyword args for the call to
legend.**kwargs – Passed to
vlines.