Created
September 17, 2015 17:50
-
-
Save aconz2/c650990b060cabd4c1c2 to your computer and use it in GitHub Desktop.
Iterate through a series of matplotlib plots, waiting for keyboard input (from the terminal)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from matplotlib import pyplot as plt | |
plt.ion() | |
# say you have a bunch of distributions you'd like to look at | |
data_sets = [np.random.poisson(lam, size=100), for lam in np.random.randint(1, 100, size=10)] | |
# in a REPL, this one-liner makes it easy to plot each one successively waiting for ENTER from the terminal | |
_ = [[plt.hist(data), input()] for data in data_sets] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment