Closed tingyuansen closed 8 years ago
sorry, I don't understand. why wouldn't the first entry in this case be plotted?
Hi Anna,
Sorry for not being clearer, what I meant is that there will be a broken part in the plot. You can try the following codes to see the difference.
x_array = np.arange(6) y_array = np.arange(6) y_array_masked = np.ma.array(y_array, mask=[0,0,1,0,0,0]) plt.plot(x_array,y_array_masked)
x_array_restricted = x_array[np.where(x_array != 2)] y_array_restricted = y_array[np.where(x_array != 2)] plt.plot(x_array_restrict,y_array_restrict)
Thanks!
In some occasions, the code plots the results using masked numpy arrays. This might mess up the plotting. For example, if one considers np.ma.array(A, mask=[0,1,0,0,0]), only the last three entries are plotted, even though the first entry is not masked.