PlotAxes.parametric¶
- PlotAxes.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, 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 fromnormandcmap. 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 andcmapis ignored – for example,colors='blue'makes a monochromatic “parametric” line.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.,
DataFrameorDataset). If passed, each data argument can optionally be a stringkeyand 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. Formatting ofpint.Quantityunit strings is controlled byrc.unitformat='L'.
- 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 data value normalizer, passed to theNormconstructor function. IfdiscreteisTruethen 1) this affects the default level-generation algorithm (e.g.norm='log'builds levels in log-space) and 2) this is passed toDiscreteNormto scale the colors before they are discretized (ifnormis not already aDiscreteNorm).extend (
{'neither', 'both', 'min', 'max'}, optional) – Direction for drawing colorbar “extensions” (i.e. color keys for out-of-bounds data on the end of the colorbar). Default is'neither'.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 isTruefor only contour-plotting commands likecontourfand pseudocolor-plotting commands likepcolor.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.vmin, vmax (
float, optional) – The minimum and maximum color scale values used with thenormnormalizer. IfdiscreteisFalsethese are the absolute limits, and ifdiscreteisTruethese are the approximate limits used to automatically determinelevelsorvalueslists at “nice” intervals. Iflevelsorvalueswere already passed as lists, these are ignored, andvminandvmaxare set to the minimum and maximum of the lists. Ifrobustwas passed, the defaultvminandvmaxare some percentile range of the data values. Otherwise, the defaultvminandvmaxare the minimum and maximum of the data values.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.label, value (
floatorstr, 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
LineCollectionproperties.
- Returns
LineCollection– The parametric line. See this matplotlib example.