I have been using gnuplot for as long as I remember. Recently i have been wanting to switch to matplotlib.
One basic function of gnuplot i frequently use is the 'index' function.
Suppose I have the following data file (foo.dat):
1 1
2 2
3 3
1 1
2 4
3 9
I could do:
plot 'foo.dat' index 0 u 1:2
replot 'foo.dat' index 1 u 1:2
to get two lines corresponding to the two data sets in the same plot. How would one import such a file using numpy and plot it using matplotlib?

