On 04/26/2011 09:36 AM, butt...@gmail.com wrote: > I believe this feature, which has been requested a number of times, but > is still missing from matplotlib is genuinely useful for interactive > plotting. Moreover, I've heard matlab has it... > > Here's a potential solution to cover my simple plotting needs. The goal > is not to support all the weird and wonderful matplotlib features, if > you need those you probably work only from script anyway. My approach is > based on figureoptions.py in matplotlib.backends.qt4_editor (or the more > recent version in spyder): > > 1) Save figure file: > . get xy data for each plot object > . get object styles (color of plots, linestyle, etc.) > . save to auto-generated python script > > Later... > > 2) Open figure file: > The script will open a new figure, recreate all objects and then apply > styles to each object. > >> You have full control over the figure and its contents again for editing > > Using this approach backwards compatibility should not be a issue (as > demonstrated by figureoptions). On the other hand not all matplotlib > objects/options will be supported. > > Any comments or suggestions ?
Implementing anything like this will immediately lead to a stream of complaints that it doesn't support "all the weird and wonderful matplotlib features". The vector backends are actually doing something like this, but saving in their respective graphics languages instead of in python. Presumably some sort of "matplotlib_script" backend could be written, using the pdf or svg backend as a template. Better practice is to use something like the ipython logging facility to save one's interactive commands, and then manually to edit that down to a script that creates the desired figure. That way one retains full control, reproducibility, and documentation of what went into a figure. Eric > > ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users