Skip to content

Commit

Permalink
Updated docs with QuadMesh example
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jan 8, 2018
1 parent c12928d commit 295b438
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions doc/Gridded_Datasets_II.ipynb
Expand Up @@ -56,9 +56,7 @@
"metadata": {},
"outputs": [],
"source": [
"kdims = ['realization', 'longitude', 'latitude', 'time']\n",
"vdims = ['surface_temperature']\n",
"dataset = gv.Dataset(xr_ensembles, kdims=kdims, vdims=vdims, crs=ccrs.PlateCarree())\n",
"dataset = gv.Dataset(xr_ensembles, vdims='surface_temperature', crs=ccrs.PlateCarree())\n",
"dataset"
]
},
Expand Down Expand Up @@ -143,7 +141,27 @@
"source": [
"Using ``dynamic`` mode means that the data for each frame is only extracted when you're actually viewing that part of the data, which can have huge benefits in terms of speed and memory consumption. However, it relies on having a running Python process to render and serve each image, and so it cannot be used when generating static HTML output such as for the GeoViews web site.\n",
"\n",
"## Irregularly sampled data\n",
"\n",
"Often gridded datasets are not regularly sampled, instead providing irregularly sampled multi-dimensional coordinates. Such datasets can be easily visualized using the QuadMesh element."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%opts QuadMesh [colorbar=True fig_size=300 projection=ccrs.Robinson()] (cmap='RdBu_r')\n",
"xrds = xr.tutorial.load_dataset('RASM_example_data')\n",
"qmesh = gv.Dataset(xrds.Tair).to(gv.QuadMesh, ['xc', 'yc'], dynamic=True)\n",
"qmesh.redim.range(Tair=(-30, 30)) * gf.coastline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Non-geographic views\n",
"\n",
"So far we have focused entirely on geographic views of the data, plotting the data on a projection. However the conversion interface is completely general, allowing us to slice and dice the data in any way we like. For these views we will switch to the bokeh plotting extension:"
Expand Down

0 comments on commit 295b438

Please sign in to comment.