Use hvplot to make Python pandas plots interactive with pan, zoom, and hover
Use hvplot to make Python pandas plots interactive with pan, zoom, and hover
For example, run the following:
pip install hvplot
Next run the following in Python:
import pandas as pd, numpy as np
idx = pd.date_range(‘1/1/2000’, periods=1000)
df = pd.DataFrame(np.random.randn(1000, 4), index=idx, columns=list(‘ABCD’)).cumsum()
import hvplot.pandas # noqa
df.hvplot()
Then use the mouse to drag. Select “Wheel Zoom” icon in the menu at the right of the plot to enable mouse wheel zooming.
Stay up to date. Subscribe to my posts https://morrislee1234.wixsite.com/website/contact
Web site with my other posts by category https://morrislee1234.wixsite.com/website
LinkedIn https://www.linkedin.com/in/morris-lee-47877b7b