Filled Contour Plot#

A filled contour plot of a synthetic dataset.

import hvplot.xarray  # noqa
import numpy as np
import xarray as xr

x = y = np.linspace(-10, 10, 200)
X, Y = np.meshgrid(x, y)
Z = 10 * np.exp(-(X**2 + Y**2) / 20)
ds = xr.DataArray(Z, coords=[("y", y), ("x", x)], name="z").to_dataset()

ds.hvplot.contourf(
    x="x",
    y="y",
    z="z",
    levels=10,
    cmap="viridis",
    data_aspect=1,
    title="Filled Contour Plot (Bokeh)",
)
import hvplot.xarray  # noqa
import numpy as np
import xarray as xr
hvplot.extension('matplotlib')

x = y = np.linspace(-10, 10, 200)
X, Y = np.meshgrid(x, y)
Z = 10 * np.exp(-(X**2 + Y**2) / 20)
ds = xr.DataArray(Z, coords=[("y", y), ("x", x)], name="z").to_dataset()

ds.hvplot.contourf(
    x="x",
    y="y",
    z="z",
    levels=10,
    cmap="viridis",
    data_aspect=1,
    title="Filled Contour Plot (Matplotlib)",
)
This web page was generated from a Jupyter notebook and not all interactivity will work on this website.