Hello everyone, I have a problem. I have to look at many plots. Usely I do it like that:
from pylab import* X1 = genfromtxt("Myfile.dat", usecols =(0)) Y1 = genfromtxt("Myfile.dat", usecols =(1)) plot(X1,Y1, label ="My curve") show() But the problem is when I have many plots I have to copy paste and change manually all the name of the variables X1, X2, X3...etc. It's not really convenient. I want to create a def with the name of my file as argument which do something like that: from pylab import* def plotgraph(name): X_name = genfromtxt("name", usecols =(0)) Y_name = genfromtxt("name", usecols =(1)) plot(X_name,Y_name, label ="name") plotgraph(MyFile) show() But it doesn't work. Do you know why? Do you have a smarter idea? Thanks! Fab ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users