{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import hvplot.xarray # noqa" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Similar to [`image`](image.ipynb), `contour` displays values on a 2d grid. But it first segments data into various levels." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "\n", "ds = xr.tutorial.open_dataset('air_temperature')\n", "ds" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.hvplot.contour()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are lots of options exposed to control the style and contents of the `contour` plot:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.mean(dim='time').hvplot.contour(z='air', x='lon', y='lat', levels=20, \n", " clabel='T [K]', label='Mean Air temperature [K]',\n", " cmap='gray')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Geographic Data\n", "\n", "Include a basemap from a tiling service using the `tiles` option." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.hvplot.contour(geo=True, tiles='EsriImagery', levels=20, line_width=2, cmap='reds',)" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 4 }