In [1]:
import numpy as np
# IPython ShimWarning shows local path, disable it
from IPython.utils.shimmodule import ShimWarning
import warnings
warnings.simplefilter('ignore', ShimWarning)
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
%matplotlib notebook
In [2]:
# Simple data to display in various forms
x = np.linspace(0, 2 * np.pi, 400)
y = np.array([i*np.sin(x ** 2) for i in np.arange(16)+1])
y = np.reshape(y, (4, 4, len(x)))
Create SubsetSelector with data and plot. y should be a multidimensional array. Each sample from a subset of y is graphed. You can scroll through subsets using the figure's toolbar, select graphs of interest, and get the data back from them later. Execute the cell below and click on some graphs to try it out.
In [3]:
from subset_selector import SubsetSelector
ss = SubsetSelector(x, y)
ss.plot()
In [5]:
saved_data = ss.get_ydata()
figure, _ = plt.subplots(1, 2, figsize=(12, 2))
for data, ax in zip(saved_data, figure.get_axes()):
ax.plot(x, data)