load and plot from multiple file

Tim Harig usernet at ilthio.net
Sat Jul 10 04:13:10 EDT 2010


On 2010-07-10, rudra <bnrj.rudra at gmail.com> wrote:
> Dear friends,
> I have several 2 column file which i need to plot in one figure.
> I generally do it using  gnuplot, but when there is several files, its
> hard to do manually.
> can you tell me how i can load a file in python and plot several file
> in one figure(as it is  done via replot in gnuplot)?
> I am novice in python, but tried the matplotlib...with no luck.
> will u plz help?

It would really help to see a representative sample of the data that you
are working with and what you want the plot to look like.  Other then that,
you likely just want to load the data from the file into lists (ordered
together, lists with sublists, or potentially into a list ofrepresentative
objects).  You can then simply open a pipe to gnuplot and send it the
commands it needs to create your plot.  You could also just create a single
comined file with all of the information to plot and then use it to create
you plots.



More information about the Python-list mailing list