On 06/01/2010 02:47 PM, Benjamin Root wrote: > Howard, > > Are you trying to plot 4 lines with the same y-axis or with two or more > y-axes? I only ask because the values of your 5th column are many > orders of magnitude smaller than the values of the other ys. > > If you want multiple y-axes on the same plot, then you might want to > look at Parasite Axes. If not, then you can very simply plot this like > so (assuming that 'data' is a 2-D numpy array). > > import matplotlib.pyplot as plt > > plt.plot(data[:, 0], data[:, 1]) > plt.plot(data[:, 0], data[:, 2]) > plt.plot(data[:, 0], data[:, 3]) > plt.plot(data[:, 0], data[:, 4]) > > plt.show() > > I am sure that my 4 plot statements can be simplified, but I can't > verify that right now.
import numpy as np import matplotlib.pyplot as plt x = np.arange(2, 5, 0.3) y = np.random.randn(len(x), 4) # dummy data for illustration plt.plot(x, y) So with the data array as above, it would be plt.plot(data[:,0], data[:, 1:]) Eric > > I hope that helps. > > Ben Root ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users