xarray.DataArray.plot.contourf¶
-
DataArray.plot.contourf(x, y, **kwargs)¶ Filled contour plot of 2d DataArray
Wraps
matplotlib.pyplot.contourf()- Parameters
darray (
DataArray) – Must be 2 dimensional, unless creating faceted plotsx (
string, optional) – Coordinate for x axis. If None use darray.dims[1]y (
string, optional) – Coordinate for y axis. If None use darray.dims[0]figsize (
tuple, optional) – A tuple (width, height) of the figure in inches. Mutually exclusive withsizeandax.aspect (scalar, optional) – Aspect ratio of plot, so that
aspect * sizegives the width in inches. Only used if asizeis provided.size (scalar, optional) – If provided, create a new figure for the plot with the given size. Height (in inches) of each plot. See also:
aspect.ax (
matplotlib axes object, optional) – Axis on which to plot this figure. By default, use the current axis. Mutually exclusive withsizeandfigsize.row (
string, optional) – If passed, make row faceted plots on this dimension namecol (
string, optional) – If passed, make column faceted plots on this dimension namecol_wrap (
int, optional) – Use together withcolto wrap faceted plotsxscale, yscale (
'linear','symlog','log','logit', optional) – Specifies scaling for the x- and y-axes respectivelyxticks, yticks (
Specify tick locations for x-andy-axes)xlim, ylim (
Specify x-andy-axes limits)xincrease (
None,True, orFalse, optional) – Should the values on the x axes be increasing from left to right? if None, use the default for the matplotlib function.yincrease (
None,True, orFalse, optional) – Should the values on the y axes be increasing from top to bottom? if None, use the default for the matplotlib function.add_colorbar (
bool, optional) – Adds colorbar to axisadd_labels (
bool, optional) – Use xarray metadata to label axesnorm (
matplotlib.colors.Normalizeinstance, optional) – If thenormhas vmin or vmax specified, the corresponding kwarg must be None.vmin, vmax (
floats, optional) – Values to anchor the colormap, otherwise they are inferred from the data and other keyword arguments. When a diverging dataset is inferred, setting one of these values will fix the other by symmetry aroundcenter. Setting both values prevents use of a diverging colormap. If discrete levels are provided as an explicit list, both of these values are ignored.cmap (
:doc:matplotlib colormap nameorobject, optional) – The mapping from data values to color space. If not provided, this will be either beviridis(if the function infers a sequential dataset) orRdBu_r(if the function infers a diverging dataset). When Seaborn is installed,cmapmay also be a seaborn color palette. Ifcmapis seaborn color palette and the plot type is notcontourorcontourf,levelsmust also be specified.colors (
discrete colorstoplot, optional) – A single color or a list of colors. If the plot type is notcontourorcontourf, thelevelsargument is required.center (
float, optional) – The value at which to center the colormap. Passing this value implies use of a diverging colormap. Setting it toFalseprevents use of a diverging colormap.robust (
bool, optional) – If True andvminorvmaxare absent, the colormap range is computed with 2nd and 98th percentiles instead of the extreme values.extend (
{"neither", "both", "min", "max"}, optional) – How to draw arrows extending the colorbar beyond its limits. If not provided, extend is inferred from vmin, vmax and the data limits.levels (
intorlist-like object, optional) – Split the colormap (cmap) into discrete color intervals. If an integer is provided, “nice” levels are chosen based on the data range: this can imply that the final number of levels is not exactly the expected one. Settingvminand/orvmaxwithlevels=Nis equivalent to settinglevels=np.linspace(vmin, vmax, N).infer_intervals (
bool, optional) – Only applies to pcolormesh. If True, the coordinate intervals are passed to pcolormesh. If False, the original coordinates are used (this can be useful for certain map projections). The default is to always infer intervals, unless the mesh is irregular and plotted on a map projection.subplot_kws (
dict, optional) – Dictionary of keyword arguments for matplotlib subplots. Only used for 2D and FacetGrid plots.cbar_ax (
matplotlib Axes, optional) – Axes in which to draw the colorbar.cbar_kwargs (
dict, optional) – Dictionary of keyword arguments to pass to the colorbar.**kwargs (optional) – Additional arguments to wrapped matplotlib function
- Returns
The same type of primitive artist that the wrapped matplotlib function returns
- Return type
artist