Re: [matplotlib-devel] updating a plot without calling plot

2007-10-23 Thread Michael Droettboom
Nice to hear you found a solution.  Still, it would nice if the obvious 
way to do it didn't leak memory ;)  I thought the memory leak hunting I 
did a few months ago had resolved this, but it wasn't testing exactly 
the same thing -- it was creating figures directly in each iteration, 
not just calling plot.  I'll look into this further.

Cheers,
Mike

Darren Dale wrote:
> On Friday 19 October 2007 05:23:38 pm Darren Dale wrote:
>> I'm having some trouble updating a plot window without calling plot. I
>> would like to do something like:
>>
>> ax = axes()
>> lines, = plot([1,2,3], [1,2,3])
>> lines.set_ydata([4,5,6])
>> ax.autoscale_view()
>> ax.draw()
>>
>> The line does get updated, but the axes limits are not updated. I've looked
>> into the Axes.plot code, and as far as I can tell, the above code should
>> work. Can anyone tell me what is the right way to do this?
> 
> I guess I should point out why I can't call plot. I'm rapidly losing physical 
> memory, even when I call ax.hold(False):
> 
> ax = axes() # ipython using 51 MB
> ax.plot(arange(100)) # ipython using 81 MB
> ax.hold(False)
> ax.plot(arange(100)) # ipython using 138 MB
> ax.plot(arange(100)) # ipython using 142 MB
> ax.hold(True)
> ax.plot(arange(100)) # ipython using 172 MB
> ax.plot(arange(100)) # ipython using 203 MB
> 
> Darren
> 
> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] EPS output problem - scatter & edgecolors

2007-10-23 Thread Michael Droettboom
Darren Dale wrote:
> On Friday 19 October 2007 10:55:24 am John Hunter wrote:
>> On 10/19/07, Darren Dale <[EMAIL PROTECTED]> wrote:
>>> I removed a gsave/grestore pair surrounding RendererPS._draw_ps in
>>> svn-3967. It looks like this fixed the problem (graphics state was being
>>> lost). I checked contour_demo.py for any unintended side-effects, and
>>> didn't find any, but please keep an eye out for strange behavior.
>> I added this gsave/grestore pair in draw_ps because in a first attempt
>> to get Ellipse working properly with axis='auto'.  I was using an
>> approach inspired by Michael's branch, which is to create a unit
>> circle and then apply rotation and scaing transformation to make the
>> ellipse.  The transformation settings were persistent so I wrapped all
>> of the draw_ps in a save/restore block to insulate them.
>>
>> Then I realized that doing the transformation in PS wreaks all kinds
>> of havoc with the linewidth settings, and reverted the code to doing
>> the transformations in python, as we have always done.  So removing
>> the save/restore block should be fine, but file it away in the back of
>> your mind that pushing transformations in the current implementation
>> may result in unintended weirdness.

The gsave/grestore can always be placed only around the transform and 
the fill/stroke itself, not around the graphics context changes.  That's 
what I have done for the clip paths on the branch, and what the clipping 
rectangle already does on the trunk.

> Thanks for letting me know. When we first implemented draw_markers in 
> backend_ps, we let the postscript interpretter do the transforms. That turned 
> out to be a disaster. It took forever for ghostscript to render the images, 
> so we went back to doing transforms in mpl.

For both of these reasons, I also bailed on doing the transformations in 
the Postscript (and PDF, SVG and probably Cairo) on my branch as well. 
I'm leaving the backend interface as-is (where the outline and the 
transform are both passed to the backend), because that approach is 
slightly faster with the Agg backend, mainly because it doesn't have to 
make a transformed copy of all of the points before rendering.  But that 
does mean the output of the non-interactive backends will benefit less 
from all this refactoring than originally thought.  However, it should 
be helpful in the long run to have fewer backend methods to write and 
maintain.

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel