2
votes

I am using ipython notebook with pylab --inline

import matplotlib.pyplot as plt
import pandas as pd
......
plt.figsize(14,8)
ax1=plt.subplot(311)
#data is a pandas data frame with timeseries stock data
# this plots the data
data.plot(ax=ax1)

This shows a plot of the stock data but its all displayed at once. I would like to display just subrange of dates and have a scrollbar to control what range How do I do it such that it works with the inline display of plots.

2

2 Answers

3
votes

You can't. Inline display is a static PNG.

If you want something like that you will have to use a Javascript plotting library for now. None that I know of will work out of the box with panda.

3
votes

You can't manipulate plots in inline-mode after they have been drawn. However, you can scale,zoom and resize plots in the interactive mode. Just start your notebook without the inline-option and all plots will be generated in an extra window with the functionality you asked for:

ipython notebook --pylab