matplotlibメモ

numpy.whereで複数条件をかける

andとかorじゃないんですね

numpy.where((y > thresh1) | (y < thresh2) )

http://stackoverflow.com/questions/15373753/multiple-conditions-in-numpy-where

一部をマスクしたグラフを書く

np.ma.masked_whereというのを使えばいいらしい

y_values_masked = np.ma.masked_where(y_values < threshold , y_values)
(中略)
plt.plot(x_values, y_values_masked,'ko')

http://wiki.scipy.org/Cookbook/Matplotlib/Plotting_values_with_masked_arrays