Re: [Matplotlib-users] imsave() function

2009-02-07 Thread John Hunter
On Fri, Feb 6, 2009 at 8:34 AM, Gary Ruben  wrote:
> Hi all,
>
> I've attached a candidate imsave() to complement imread() in the image.py
> module. Would my use of pyplot instead of the oo interface preclude its
> inclusion in image.py? Also, I noticed some problems when I ran the tests
> with the Wx backends with mpl 0.98.5.2 in Win32. Both of the Wx backends
> produce incorrect, but different, results.

Yes, if it imports pyplot, we can't put it in the image module.  But
you can easily rewrite your function to use the Agg backend as in

  http://matplotlib.sourceforge.net/examples/api/agg_oo.html

the agg backend will detect other extensions, like png, pdf, svg or ps
and do the right thing.  So if you'd like to resubmit this as an svn
patch that doesn't use pyplot, I think it would be a useful addition.

  http://matplotlib.sourceforge.net/faq/howto_faq.html#contributing-howto

JDH

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with set_data update/refresh in matplotlib using wxpython backend

2009-02-07 Thread John Hunter
On Fri, Feb 6, 2009 at 5:13 AM, Rezwan  wrote:
>
> Hi
> I am developing a plotting tool using matplotlib and wxpython as backend. I
> have separate thread for iperf and it creates a text file every time I want
> to create this thread and this thread finish it's task once it reach the
> duration(defined by the user). Plot and some text boxes are updated reading
> this text file every second once I press plot button. My problem is
> matplotlib keeps the old data and impose new data on the same plot. I am
> using cla function to clear the axes but how can I clear set_data for every
> new plot. What I want is to initialize set_data. Anyone here to tell me how
> can I do that? Hope my post makes sense. If not I will post with some
> snippets of my tool.
>

You will need to post some example code before we can really help, but
the best way to do this is not via cla, but by storing the line
instance and calling set_data on it

  line, = ax.plot(x, y)

and then later

  line.set_data(newx, newy)
  line.axes.figure.canvas.draw()

If you are getting overplotting, it sounds like you are making
additional calls to plot that you are overlooking.

JDH

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users