Pull out chunks of a plot made in python and re-display
Question: I have made a plot in jupyter that has an x-axis spanning for about 40
seconds. I want to pull out sections that are milliseconds long and re-display
them as separate plots (so that they can be better viewed). How would I go
about doing this?


Answer: You could use some subplots, and slice the original data arrays. For example:

    
    
    import matplotlib.pyplot as plt
    import numpy as np
    
    x = np.linspace(0,40,1000)
    y = np.random.random(1000)
    
    fig, [ax1,ax2,ax3] = plt.subplots(3,1)
    
    ax1.plot(x,y)
    ax2.plot(x[100:120],y[100:120])
    ax3.plot(x[500:520],y[500:520])
    
    plt.show()
    

[![enter image description
here](http://i.stack.imgur.com/I8h19.png)](http://i.stack.imgur.com/I8h19.png)

