Introduction to Visualization¶
Right click to download this notebook from GitHub.
In the previous step of the tutorial we made some plots using hvplot
, which provides interactive plots using a syntax similar to the Pandas .plot()
method. In addition to Pandas, hvPlot
supports XArray, Dask, GeoPandas, and a variety of other libraries. The result of an hvplot
call is a holoviews
object. This might seem a little mysterious, so we'll take a minute to show how this works. In this tutorial step we'll use generated data for simplicity.
In [1]:
import numpy as np
import pandas as pd
index = pd.date_range('1/1/2000', periods=1000)
np.random.seed(11) # seeding the state to make the output identical each time
data = np.random.randn(1000, 4)
df = pd.DataFrame(data, index=index, columns=list('ABCD')).cumsum()
df.head()
Out[1]:
Use hvplot
to product an interactively explorable plot with panning, zooming, hovering, and clickable/selectable legends:
In [2]:
import hvplot.pandas
df.hvplot()