PlotAxes.parametric¶
- PlotAxes.parametric(x, y, c, *, interp=0, scalex=True, scaley=True, **kwargs)[source]¶
Plot a parametric line.
- Parameters
*args (
y
orx
,y
) – The data passed as positional or keyword arguments. Interpreted as follows:If only
y
coordinates are passed, try to infer thex
coordinates from theSeries
orDataFrame
indices or theDataArray
coordinates. Otherwise, thex
coordinates arenp.arange(0, y.shape[0])
.If the
y
coordinates 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=True
ormedians=True
).If any arguments are
pint.Quantity
, auto-add the pint unit registry to matplotlib’s unit registry usingsetup_matplotlib
. Apint.Quantity
embedded in anxarray.DataArray
is also supported.
c, color, colors, values, labels (sequence of
float
,str
, orcolor-spec
, optional) – The parametric coordinate(s). These can be passed as a third positional argument or as a keyword argument. If they are float, the colors will be determined fromnorm
andcmap
. If they are strings, the color values will benp.arange(len(colors))
and eventual colorbar ticks will be labeled with the strings. If they are colors, they are used for the line segments andcmap
is ignored – for example,colors='blue'
makes a monochromatic “parametric” line.interp (
int
, default:0
) – Interpolate to this many additional points between the parametric coordinates. 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.,
DataFrame
orDataset
). If passed, each data argument can optionally be a stringkey
and the arrays used for plotting are retrieved withdata[key]
. This is a native matplotlib feature.autoformat (
bool
, default:rc.autoformat
=True
) – Whether thex
axis labels,y
axis labels, axis formatters, axes titles, legend titles, and colorbar labels are automatically configured when aSeries
,DataFrame
,DataArray
, orQuantity
is passed to the plotting command. Formatting ofpint.Quantity
unit strings is controlled byrc.unitformat
='L'
.
- Other Parameters
cmap (
colormap-spec
, default:rc['cmap.sequential']
='Fire'
orrc['cmap.diverging']
='BuRd'
) – The colormap specifer, passed to theColormap
constructor function. Ifrc['cmap.autodiverging']
isTrue
and the normalization range contains negative and positive values thenrc['cmap.diverging']
is used. Otherwiserc['cmap.sequential']
is used.c, color, colors (
color-spec
or sequence ofcolor-spec
, optional) – The color(s) used to create aDiscreteColormap
. If not passed,cmap
is used.norm (
norm-spec
, default:Normalize
orDivergingNorm
) – The data value normalizer, passed to theNorm
constructor function. Ifdiscrete
isTrue
then 1) this affects the default level-generation algorithm (e.g.norm='log'
builds levels in log-space) and 2) this is passed toDiscreteNorm
to scale the colors before they are discretized (ifnorm
is not already aDiscreteNorm
). Ifrc['cmap.autodiverging']
isTrue
and the normalization range contains negative and positive values thenDivergingNorm
is used. OtherwiseNormalize
is used.extend (
{'neither', 'both', 'min', 'max'}
, default:'neither'
) – Direction for drawing colorbar “extensions” indicating out-of-bounds data on the end of the colorbar.discrete (
bool
, default:rc['cmap.discrete']
=None
) – IfFalse
, thenDiscreteNorm
is 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_number
but it may improve rendering speed. Default isTrue
only for contouring commands likecontourf
and pseudocolor commands likepcolor
.sequential, diverging, cyclic, qualitative (
bool
, default:None
) – Boolean arguments used ifcmap
is not passed. Set these toTrue
to use the defaultrc['cmap.sequential']
,rc['cmap.diverging']
,rc['cmap.cyclic']
, andrc['cmap.qualitative']
colormaps. Thediverging
option also appliesDivergingNorm
as the default continuous normalizer.vmin, vmax (
float
, optional) – The minimum and maximum color scale values used with thenorm
normalizer. Ifdiscrete
isFalse
these are the absolute limits, and ifdiscrete
isTrue
these are the approximate limits used to automatically determinelevels
orvalues
lists at “nice” intervals. Iflevels
orvalues
were already passed as lists, these are ignored, andvmin
andvmax
are set to the minimum and maximum of the lists. Ifrobust
was passed, the defaultvmin
andvmax
are some percentile range of the data values. Otherwise, the defaultvmin
andvmax
are the minimum and maximum of the data values.inbounds (
bool
, default:rc['axes.inbounds']
=True
) – Whether to restrict the defaulty
(x
) axis limits to account for only in-bounds data when thex
(y
) axis limits have been locked. See alsorc['axes.inbounds']
andrc['cmap.inbounds']
.scalex, scaley (
bool
, optional) – Whether the view limits are adapted to the data limits. The values are passed on toautoscale_view
.label, value (
float
orstr
, optional) – The single legend label or colorbar coordinate to be used for this plotted element. Can be numeric or string. This is generally used with 1D positional arguments.colorbar (
bool
,int
, orstr
, optional) – If notNone
, this is a location specifying where to draw an inset 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 inset 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
LineCollection
properties.
- Returns
LineCollection
– The parametric line. See this matplotlib example.