hvPlot Announcement
A high-level plotting API for the PyData ecosystem - built on HoloViews.
We are very pleased to introduce a new visualization tool called hvPlot. hvPlot is closely modeled on the Pandas and Xarray .plot
APIs, but returns HoloViews objects that display as fully interactive Bokeh-based plots. hvPlot is significantly more powerful than other .plot
API tools that have recently become available, because it lets you use data from a wide array of libraries in the PyData ecosystem:
- Pandas: DataFrame, Series (columnar/tabular data)
- xarray: Dataset, DataArray (multidimensional arrays)
- Dask: DataFrame, Series (columnar data)
- Streamz: DataFrame(s), Series(s) (streaming columnar data)
- Intake: DataSource (data catalogs)
- GeoPandas: GeoDataFrame (geometry data)
- NetworkX: Graph (network data)
Why a new library?¶
The Python visualization landscape is crowded with many confusing alternatives. To make sure that users can easily generate at least the most basic plots, many libraries in the PyData ecosystem ship with their own Matplotlib-based plotting APIs. Matplotlib is a solid and well-established library, but lacks the interactive features of modern web-based plotting tools. With hvPlot, you can use the simple API you are already used to, while getting powerful interactive features by simply switching out an import
statement. Because hvPlot aims to provide plotting tools for all the major libraries in the PyData system, plots generated from all these different libraries can then be flexibly combined to make a figure or application. Other .plot
API tools like Pandas-Bokeh provide similar basic features but don't provide this ability to flexibly combine between libraries, nor do they let you:
- Explore multi-dimensional parameter spaces using auto-generated widgets
- Scale visualizations to millions or even billions of datapoints using Dask and Datashader integration
- Explore interactive visualizations (even streaming plots!) in the notebook, then seamlessly transition to a standalone server
A shared, consistent and familiar API¶
Whether you are plotting Pandas, Xarray, Dask, Streamz, Intake or GeoPandas data, you only need to learn one plotting API, with extensive documentation for all the options.
Interactivity¶
Let us jump straight into what hvPlot can do by generating a DataFrame containing a number of time series, then plot it. By importing hvplot.pandas
we add .hvplot
to the pandas DataFrame and Series methods and can immediately start using it. The same concept applies to the other supported libraries, e.g. import hvplot.dask
to add the method to dask DataFrame/Series objects.
import hvplot.pandas
idx = pd.date_range('1/1/2000', periods=1000)
df = pd.DataFrame(np.random.randn(1000, 4), index=idx, columns=list('ABCD')).cumsum()
df.hvplot()