Skip to content
Projects

maxplotlib.xarray

The DataArray.maxplot and Dataset.maxplot accessors.

Importing this module registers them::

import maxplotlib.xarray # noqa: F401
canvas = da.maxplot.line()
canvas.show(backend="plotly")

Every method returns a new :class:~maxplotlib.Canvas; choose the backend when rendering it. x=/y= name the dimension or coordinate for each axis, as in xarray. col=, row=, col_wrap= and sharey= lay the data out over several subplots with :meth:Canvas.facet, and canvas_kwargs= is forwarded to the Canvas constructor. Everything else is forwarded to the Canvas method of the same name (line uses plot).

Classes

NameDescription
MaxplotAccessorPlot a DataArray with maxplotlib: da.maxplot.line() etc.
MaxplotDatasetAccessorPlot one Dataset variable against another: ds.maxplot.scatter(x=, y=).

MaxplotAccessorclass#

class MaxplotAccessor(da)

Plot a DataArray with maxplotlib: da.maxplot.line() etc.

contourmethod#

def contour(**kwargs)

Contour lines of 2-D data.

contourfmethod#

def contourf(**kwargs)

Filled contours of 2-D data, with a labelled colorbar.

imshowmethod#

def imshow(**kwargs)

An image of 2-D data on evenly spaced coordinates.

linemethod#

def line(**kwargs)

Lines against the coordinate; hue=<dim> for one per value.

pcolormeshmethod#

def pcolormesh(**kwargs)

A pseudocolor mesh of 2-D data, with a labelled colorbar.

scattermethod#

def scatter(**kwargs)

Points against the coordinate; hue=<dim> for one series per value.

MaxplotDatasetAccessorclass#

class MaxplotDatasetAccessor(ds)

Plot one Dataset variable against another: ds.maxplot.scatter(x=, y=).

linemethod#

def line(x, y, hue=None, **kwargs)

Lines of variable y against variable or coordinate x.

hue names a dimension to draw one line per value of. Other arguments are as for DataArray.maxplot.line, including facets.

scattermethod#

def scatter(x, y, hue=None, **kwargs)

Points of variable y against variable or coordinate x.

hue names a dimension, for one series per value, or a variable, which colors the points by value with a labelled colorbar (turned off by add_colorbar=False; cmap, robust and center apply).