Skip to content

Commit

Permalink
Clarified nature of hvplot output and mentioned projecting with geoviews
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Jul 8, 2019
1 parent 6f2614c commit ac3be60
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions examples/tutorial/05_Composing_Holoviews_Plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"So far we have generated plots using hvplot, but we haven't discussed what exactly these plots are and all the things that you can do with them. The short answer is that they are [holoviews](https://holoviews.org) objects rendered using the [bokeh](https://bokeh.org) backend. In the [last notebook](04_Using_.plot.ipynb) we saw holoviews supporting grouping and linking between subplots and bokeh supporting interactivity. \n",
"So far we have generated plots using hvplot, but we haven't discussed what exactly these plots are and how they are different from the output of other libraries offering the `.plot` API. The short answer is that they are [holoviews](https://holoviews.org) objects rendered using the [bokeh](https://bokeh.org) backend. In the [last notebook](04_Using_.plot.ipynb) we saw how the HoloViews output of `hvplot` results in Bokeh plots that support interactivity such as panning and zooming. \n",
"\n",
"In this notebook, we'll deconstruct hvplot output to show what individual elements are and discuss how they can be combined and used to compose layered visualizations."
"In this notebook, we'll examine the output of hvplot calls to take a look at individual HoloViews elements. Then we will see how these elements offer us powerful ways of combining and composing layered visualizations."
]
},
{
Expand Down Expand Up @@ -86,15 +86,32 @@
"outputs": [],
"source": [
"monthly_count = cleaned_reindexed_df.id.resample('1M').count().rename('count')\n",
"monthly_count_plot = monthly_count.hvplot(title='Monthly count')\n",
"monthly_count_plot = monthly_count.hvplot(title='Monthly count')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The first thing to note is that with `hvplot`, it is common to grab a handle on the returned output. Unlike the matplotlib based `.plot` API of pandas where an axis object is returned (with plotting display occuring as a side-effect if matplotlib inline is loaded) grabbing the output of `hvplot` has no side-effects at all.\n",
"\n",
"When working with the HoloViews object returned by `hvplot`, plotting only occurs when we look at the object itself:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"monthly_count_plot"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's take a closer look at this plot object."
"Now we have a handle on this object, we can look at its textual representation by printing it:"
]
},
{
Expand Down Expand Up @@ -457,6 +474,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that the Web Mercator projection is only one of many possible projections used when working with geospatial data. If you need to work with these different projections, you can use the [GeoViews](http://geoviews.org) extension to HoloViews that makes elements aware of the projection they are defined in and the projection they are rendered to. \n",
"\n",
"\n",
"#### Exercise\n",
"\n",
"Import and use different tiles. \n",
Expand Down

0 comments on commit ac3be60

Please sign in to comment.