2018-05-14

HoloPlot Announcement

A high-level plotting API for the PyData ecosystem built on HoloViews.

We are very pleased to announce the public release of a new library called HoloPlot, which is closely modeled on the pandas plot API but is designed to work with a number of libraries:

  • 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 catalogues)
In [4]:
idx = pd.date_range('1/1/2000', periods=1000)
df  = pd.DataFrame(np.random.randn(1000, 4), index=idx, columns=list('ABCD')).cumsum()

df.plot()
Out[4]:
In [6]:
columns = ['Burglary rate', 'Larceny-theft rate', 'Robbery rate', 'Violent Crime rate']
crime.plot.violin(y=columns, group_label='Type of crime', value_label='Rate per 100k')
Out[6]:

Installation

HoloPlot supports Python 2.7, 3.5, 3.6 and 3.7 on Linux, Windows, or Mac and can be installed with conda:

conda install -c pyviz holoplot

or with pip:

pip install holoplot

For JupyterLab support, the jupyterlab_holoviews extension is also required::

jupyter labextension install @pyviz/jupyterlab_holoviews

Usage

The simplest way of using HoloPlot is by importing the appropriate module, which will patch the corresponding library. For example to replace the pandas plot interface with holoplot simply run:

In [27]:
import holoplot.pandas

Alternatively a more explicit way to patch the library is to call the patch method:

In [30]:
holoplot.patch('pandas')

Finally HoloPlot may be used without any patching by wrapping the data in a HoloPlot object:

In [36]:
plot = holoplot.HoloPlot(df)
plot()
Out[36]:

Streaming Plots

In [ ]:
from streamz.dataframe import Random
import holoplot.streamz

streaming_df = Random(freq='5ms') 

streaming_df.plot(backlog=100, height=400, width=500) +\
streaming_df.plot.hexbin(x='x', y='z', backlog=2000, height=400, width=500)

Gridded data

In [41]:
air_ds = xr.tutorial.load_dataset('air_temperature')
air_ds.air.isel(time=slice(0, 100, 20)).plot(colorbar=False, col='time', width=200, height=150, xaxis=False, yaxis=False)
Out[41]:

Display

HoloPlot is designed to work well in and outside the notebook

Statistical Plots

In [12]:
holoplot.scatter_matrix(iris, c="species")
Out[12]:

Roadmap

HoloPlot is a very young library and still under active development.

  • Improved support for geographic plots including geopandas
  • Stabilize API