Skip to content

Commit

Permalink
Updated notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 25, 2017
1 parent 5a9badc commit 0dc4ed6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
7 changes: 2 additions & 5 deletions doc/Gridded_Datasets_I.ipynb
Expand Up @@ -318,11 +318,8 @@
"source": [
"%%opts Curve [aspect=2 xticks=4 xrotation=15] Points (color='k')\n",
"temp_curve = hv.Curve(xr_dataset.select(longitude=0, latitude=10), kdims=['time'])\n",
"\n",
"temp_maps = [cb.to(gv.Image,['longitude', 'latitude']) * gv.Points([(0,10)], crs=crs.PlateCarree()) \n",
" for cb in [xr_dataset, air_temperature]]\n",
"\n",
"hv.Layout(temp_maps + [temp_curve]).cols(2)"
"temp_map = xr_dataset.to(gv.Image,['longitude', 'latitude']) * gv.Points([(0,10)], crs=crs.PlateCarree())\n",
"temp_map + temp_curve"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions doc/Gridded_Datasets_II.ipynb
Expand Up @@ -201,7 +201,7 @@
"source": [
"## Lower-dimensional views\n",
"\n",
"So far all the conversions shown have incorporated each of the available coordinate dimensions explicitly. However, often times we want to see the spread of values along one or more dimensions, pooling all the other dimensions together. A simple example of this is a box plot where we might want to see the spread of surface_temperature on each day, pooled across all latitude and longitude coordinates. To pool across particular dimensions, we can explicitly declare the \"map\" dimensions, which are the key dimensions of the HoloMap container rather than those of the Elements contained in the HoloMap. By declaring an empty list of ``mdims``, we can tell the conversion interface to pool across all dimensions *except* the particular key dimension(s) supplied, in this case the `'time'` (plot **A**) and `'realization'` (plot **B**):"
"So far all the conversions shown have incorporated each of the available coordinate dimensions explicitly. However, often times we want to see the spread of values along one or more dimensions, pooling all the other dimensions together. A simple example of this is a box plot where we might want to see the spread of surface_temperature on each day, pooled across all latitude and longitude coordinates. To pool across particular dimensions, we can explicitly declare the \"map\" dimensions, which are the key dimensions of the HoloMap container rather than those of the Elements contained in the HoloMap. By explicitly declaring no dimensions to ``groupby``, we can tell the conversion interface to pool across all dimensions *except* the particular key dimension(s) supplied, in this case the `'time'` (plot **A**) and `'realization'` (plot **B**):"
]
},
{
Expand All @@ -220,7 +220,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This approach also gives us access to other statistical plot types. For instance, with the ``seaborn`` library installed, we can use the ``Distribution`` Element, which visualizes the data as a kernel density estimate. In this way we can visualize how the distribution of surface temperature values varies over time and the model realizations. We do this by omitting 'latitude' and 'longitude' from the list of mdims, generating a lower-dimensional view into the data, where a temperature histogram is shown for every `'realization'` and `'time'`, using `GridSpace`:"
"This approach also gives us access to other statistical plot types. For instance, with the ``seaborn`` library installed, we can use the ``Distribution`` Element, which visualizes the data as a kernel density estimate. In this way we can visualize how the distribution of surface temperature values varies over time and the model realizations. We do this by omitting 'latitude' and 'longitude' from the list of dimensions, generating a lower-dimensional view into the data, where a temperature histogram is shown for every `'realization'` and `'time'`, using `GridSpace`:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/Projections.ipynb
Expand Up @@ -76,7 +76,7 @@
"outputs": [],
"source": [
"hv.Layout([gf.coastline.relabel(group=p.__name__)(plot=dict(projection=p()))\n",
" for p in projections]).display('all')"
" for p in projections])"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions doc/Working_with_Bokeh.ipynb
Expand Up @@ -126,8 +126,8 @@
},
"outputs": [],
"source": [
"%%opts Overlay [width=600 height=300 xaxis=None yaxis=None] \n",
"%%opts Points (size=0.005 cmap='viridis') [tools=['hover'] size_index=2 color_index=2]\n",
"%%opts Overlay [width=600 height=300] \n",
"%%opts Points (size=0.005 cmap='viridis') [tools=['hover'] size_index=2 color_index=2 xaxis=None yaxis=None]\n",
"(gv.WMTS(tiles['Wikipedia']) *\\\n",
"population.to(gv.Points, kdims=['Longitude', 'Latitude'],\n",
" vdims=['Population', 'City', 'Country'], crs=ccrs.PlateCarree()))"
Expand Down Expand Up @@ -181,9 +181,9 @@
},
"outputs": [],
"source": [
"%%opts Shape (cmap='viridis') [xaxis=None yaxis=None tools=['hover'] width=400 height=500 colorbar=True]\n",
"%%opts Shape (cmap='viridis') [tools=['hover'] width=450 height=600 colorbar=True toolbar='above' xaxis=None yaxis=None]\n",
"gv.Shape.from_records(shapes.records(), referendum, on='code', value='leaveVoteshare',\n",
" index='name', crs=ccrs.PlateCarree(), group='EU Referendum')"
" index='name', crs=ccrs.PlateCarree(), group='EU Referendum')"
]
},
{
Expand Down

0 comments on commit 0dc4ed6

Please sign in to comment.