From: sam t. <sam...@ya...> - 2009-02-25 23:53:28
|
Troels Kofoed Jacobsen wrote: > On Wednesday 25 February 2009 09:35:07 am sam tygier wrote: >> I think this topic has come up before, but i don't think anything has >> resulted from it. >> >> I'd like a way for saving a plot from from matplotlib, so that it can be >> re-rendered later, possibly with a different backend, maybe to a different >> size, and maybe with changes to the labels. This would save me having to >> rerun the simulation that generated the plot. > > I think this is a good idea, but why don't you just save your data to a file > and plot from a different script. If the data is only numbers you can just do > savetxt('data.dat',data) in you simulation script and then > data=loadtxt('data.dat') from your plot script... > Now if you also just use savefig('fig') without suffix, you can just run your > plot script like: python plot.py -DAgg or -DPS or whatever and it will plot to > the default format for that backend. > > Best regards > Troels Kofoed Jacobsen That is one method that i have used, but i don't think it is ideal. My data can be a wide range of things, sometimes the coordinates of a bunch of many particles, sometimes the track of one. If I save just an array of numbers it can get a bit confusing. So it would be useful to be able to save everything needed to make the plot. Sam Tygier |