On Thu, Aug 19, 2010 at 6:49 AM, Rob Schneider <rmsc...@rmschneider.com> wrote:
>> On Wed, Aug 18, 2010 at 3:32 PM, Friedrich Romstedt
>> <friedrichromst...@gmail.com> wrote:
>>> 2010/8/14 Rob Schneider <rmsc...@rmschneider.com>:
>>>>> Agreed. The only thing I can think of is that the second figure is
>>>>> reusing the first. You can try calling plt.figure() at the beginning
>>>>> of the functions to create a new figure, or call plt.figure() in
>>>>> between the calls to CreateMemberStatCategoryFigure() and
>>>>> CreateMemberStatFigure(). I can't be sure since you didn't include the
>>>>> code that actually calls these functions.
>>>
>>> Still, there shouldn't be artists rendered outside of the axes.  I
>>> often replot things and do not create a new figure.  I believe there
>>> is something under the hood!  It *should* be unnecessary to create a
>>> new fig, although it surely fixes the thing, and is an easy enough
>>> fix.
>>
>> One bar chart was categorical, the other based on dates. That threw
>> the axes scaling completely off. There weren't any misdrawn artists,
>> unless you're referring to the jumble of text. These are actually
>> tightly packed ticklabels for x-axis. Since the scaling is fubar-ed,
>> it looks messed up.
>>
>> Not sure what could be reasonably expected in such a case.
>>
>> Ryan
>>
>> --
>> Ryan May
>> Graduate Research Assistant
>> School of Meteorology
>> University of Oklahoma
>>
>
> I think the graphs were composed correctly, else why would they ever work? 
> They were fixed by calling the figure() and close() functions.  i'm reporting 
> that to the list with the hope that others can value from it.

The graphs *were* composed just fine, that wasn't my point. The
problem was that the original code tried (by accident) to take two
fundamentally different graphs and put them on the same axes.
Matplotlib assumes that unless you tell it otherwise [by creating a
new figure or calling hold(false)], everything should be on the same
figure. Hence, adding a call to figure() fixes the problem by putting
the second graph on its own figure. Now, if there is not an existing
figure, the commands from pyplot will create one for you, but that's
only in the case where there are no existing (live, not closed)
figures.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to