explorer#
The Explorer is a Panel-based web application with which you can easily explore your data. While using .hvplot()
is a convenient way to create plots from data, it assumes some a piori knowledge about the data itself and its structure, and also knowdlege about .hvplot()
โs API itself. The Explorer is a graphical interface that offers a simple way to select and visualize the kind of plot you want to see your data with, and many options to customize that plot.
Note
The Explorer has been added to hvPlot in version 0.8.0
with support for Pandas objects. Support for Xarray objects has been added in version 0.9.0
. Support for more data types will be added in future versions, in the meantime please report any issue or feature request on GitHub.
Set up#
Setting up the explorer is pretty simple in a notebook, you just need to make sure you have loaded the extension, either via a data type import (e.g. import hvplot.pandas
) or directly (e.g. hvplot.extension('bokeh')
).
import hvplot.pandas # noqa
Basic usage#
from bokeh.sampledata.penguins import data as df
df.head(2)
species | island | bill_length_mm | bill_depth_mm | flipper_length_mm | body_mass_g | sex | |
---|---|---|---|---|---|---|---|
0 | Adelie | Torgersen | 39.1 | 18.7 | 181.0 | 3750.0 | MALE |
1 | Adelie | Torgersen | 39.5 | 17.4 | 186.0 | 3800.0 | FEMALE |
The explorer is available on the .hvplot
namespace together with the other plotting methods. It accepts most of the parameters accepted by the .hvplot()
API. For the purpose of producing a nice example on the documentation we will instantiate an explorer with some pre-defined parameters; usually you would instantiate it without so many parameters.
explorer = df.hvplot.explorer(x='bill_length_mm', y='bill_depth_mm', by=['species'])
explorer
Spend some time browser the explorer and the options it offers. On this webpage itโs not going to update the preview plot and code interactively, as it needs an active Python kernel, but you will get a good feeling of all you can do with it.
Once you are done exploring the data you may want to record the settings you have configured or save the plot. The easiest option consists of opening the Code tab next to Plot and copy/pasting the code displayed in a new notebook cell, executing it will generate exactly the same code as seen in the explorer.
The code string is also available on the code
attribute:
eval(explorer.code)
Conclusion#
For information on using .hvplot.explorer()
take a look at the User Guide.