Introduction#
The PyData ecosystem has a number of core Python data containers that allow users to work with a wide array of datatypes, including:
Pandas: DataFrame, Series (columnar/tabular data)
Rapids cuDF: GPU DataFrame, Series (columnar/tabular data)
Dask: DataFrame, Series (distributed/out of core arrays and columnar data)
XArray: Dataset, DataArray (labelled multidimensional arrays)
Streamz: DataFrame(s), Series(s) (streaming columnar data)
Intake: DataSource (data catalogues)
GeoPandas: GeoDataFrame (geometry data)
NetworkX: Graph (network graphs)
Many of these libraries have the concept of a high-level plotting API that lets a user generate common plot types very easily. The native plotting APIs are generally built on Matplotlib, which provides a solid foundation, but means that users miss out the benefits of modern, interactive plotting libraries for the web like Bokeh and HoloViews.
hvPlot provides a high-level plotting API built on HoloViews that provides a general and consistent API for plotting data in all the formats mentioned above.
As a first simple illustration of using hvPlot, let’s create a small set of random data in Pandas to explore:
import numpy as np
import pandas as pd
index = pd.date_range('1/1/2000', periods=1000)
df = pd.DataFrame(np.random.randn(1000, 4), index=index, columns=list('ABCD')).cumsum()
df.head()
A | B | C | D | |
---|---|---|---|---|
2000-01-01 | -1.352302 | 0.571198 | 0.157477 | 0.105620 |
2000-01-02 | -2.144710 | 0.438733 | 0.158170 | -0.285859 |
2000-01-03 | -2.115401 | 0.748802 | 0.219641 | 1.589651 |
2000-01-04 | -3.296774 | 0.501625 | -0.436313 | 0.760851 |
2000-01-05 | -3.425591 | 0.161927 | -2.047660 | 0.902799 |
Pandas default .plot()#
Pandas provides Matplotlib-based plotting by default, using the .plot()
method:
%matplotlib inline
df.plot();

The result is a PNG image that displays easily, but is otherwise static.
Switching Pandas backend#
To allow using hvPlot directly with Pandas we have to import hvplot.pandas
and swap the Pandas backend with:
import hvplot.pandas # noqa
pd.options.plotting.backend = 'holoviews'