Skip to content Skip to sidebar Skip to footer

Ipython Notebook Horizontal Zoom

I have subplots in an ipython notebook. I can zoom in inline using the mpld3 module. However, right now I can only zoom into a rectangle. Due to my application's nature I need hori

Solution 1:

My suggestion would be to use Plotly, which is great to create interactive plots in Jupyter.

You can get more info on how to plot time series with it HERE and info on subplots HERE. Here is what I made with your data, hopefully it does what you want!

%matplotlib inline
import plotly
from plotly import tools
import numpy as np
plotly.offline.init_notebook_mode() # run at the start of every notebook

x = np.arange(100)
y = np.sin(x)
z = np.cos(x)

trace1 = go.Scatter(x=x, y=y)
trace2 = go.Scatter(x=x, y=z)

fig = tools.make_subplots(rows=2, cols=1)

fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 2, 1)

fig['layout'].update(height=600, width=600)
plotly.offline.iplot(fig)

Post a Comment for "Ipython Notebook Horizontal Zoom"