dataset._data_plot._DataArrayPlotterGrid2D

dataset._data_plot._DataArrayPlotterGrid2D(self, da)

Plot a DataArray with a Grid2D geometry

If DataArray has multiple time steps, the first step will be plotted.

Examples

import mikeio
da = mikeio.read("../data/gebco_sound.dfs2")["Elevation"]
da.plot()

Methods

Name Description
contour Plot data as contour lines
contourf Plot data as filled contours
hist Plot DataArray as histogram (using ax.hist)
line Plot data as lines (timeseries if time is present)
pcolormesh Plot data as coloured patches

contour

dataset._data_plot._DataArrayPlotterGrid2D.contour(
    ax=None
    figsize=None
    title=None
    **kwargs
)

Plot data as contour lines

Examples

da = mikeio.read("../data/gebco_sound.dfs2")["Elevation"]
da.plot.contour()

contourf

dataset._data_plot._DataArrayPlotterGrid2D.contourf(
    ax=None
    figsize=None
    title=None
    label=None
    **kwargs
)

Plot data as filled contours

Examples

da = mikeio.read("../data/gebco_sound.dfs2")["Elevation"]
da.plot.contourf()

hist

dataset._data_plot._DataArrayPlotterGrid2D.hist(
    ax=None
    figsize=None
    title=None
    **kwargs
)

Plot DataArray as histogram (using ax.hist)

Parameters

Name Type Description Default
bins (int or sequence or str) If bins is an integer, it defines the number of equal-width bins in the range. If bins is a sequence, it defines the bin edges, including the left edge of the first bin and the right edge of the last bin. by default: rcParams["hist.bins"] (default: 10) required
ax Axes | None Adding to existing axis, instead of creating new fig None
figsize tuple[float, float] | None specify size of figure None
title str | None axes title None

See Also

matplotlib.pyplot.hist

Returns

Name Type Description
<matplotlib.axes>

line

dataset._data_plot._DataArrayPlotterGrid2D.line(ax=None, figsize=None, **kwargs)

Plot data as lines (timeseries if time is present)

pcolormesh

dataset._data_plot._DataArrayPlotterGrid2D.pcolormesh(
    ax=None
    figsize=None
    title=None
    label=None
    **kwargs
)

Plot data as coloured patches

Examples

da = mikeio.read("../data/gebco_sound.dfs2")["Elevation"]
da.plot.pcolormesh()