On 3/8/07, Fernando Perez <[EMAIL PROTECTED]> wrote:

Hi all,

today at work we ran into some odd behavior, all of which seems to be
triggered by calling hold().  I'm using a fresh SVN build from this
afternoon.

Here's the first example demonstrating the problem, it's best to run
this in a fresh pylab shell or from the command line, since I suspect
internal state matters (when it shouldn't):

import pylab as P

x = P.arange(10)
y = x+1

P.figure()
P.plot(x,label='one')
P.plot(y,label='two')
P.legend()
P.title('Two plots ok')

P.figure()
P.hold(True)
P.plot(x,label='one')
P.plot(y,label='two')
P.legend()
P.title('Two plots ok - HOLD called')
P.hold(False)

P.figure()
P.plot(x,label='one')
P.plot(y,label='two')
P.legend()
P.title('One plot MISSING!')

P.show()

#### EOF


I do not think this is a bug. The default value for the hold function is
True. When you originally plotted x and y the hold state was already set to
True. So, actually your first case and second case are the same. However,
right before your third figure you set P.hold(False) . You then plot x
followed by y. So, yes I would expect to see only one line in the final
figure. This is exactly like Matlab (perhaps with the exception that the
default state of hold is False in Matlab). Perhaps that is what is confusing
you and your colleague. In Matlab the default state of hold is False,
however in Matplotlib is looks like the default state of hold is True.

-Simon
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to