On 2/15/07, David D Clark <[EMAIL PROTECTED]> wrote:

> Thanks for the reply.  I thought it might have to do with that.  I am a
> new python/matplotlib user.  In my inexperience, I'm not sure what I
> should use for "o" in o.set_visible

o in the example above is any matplotlib artist, eg a line (returned
by plot), a text instance (returned by set_xlabel, set_ylabel,
set_title), a rectangle (returned by bar), etc..  Perhaps the example
below will clarify


In [1]: fig = figure()

In [2]: ax = fig.add_subplot(111)

In [3]: line, = ax.plot([1,2,3])

In [4]: xl = ax.set_xlabel('time')

In [5]: yl = ax.set_ylabel('volts')

In [7]: bars = ax.bar([1,2,3], rand(3))

In [8]: xl
Out[8]: <matplotlib.text.Text instance at 0x3c37238>

In [9]: yl
Out[9]: <matplotlib.text.Text instance at 0x3c37df0>

In [10]: line
Out[10]: <matplotlib.lines.Line2D instance at 0x3c3e558>

In [11]: bars
Out[11]:
[<matplotlib.patches.Rectangle instance at 0x6c92bc0>,
 <matplotlib.patches.Rectangle instance at 0x6c92be8>,
 <matplotlib.patches.Rectangle instance at 0x6c92c60>]

In [12]: xl.set_visible(False)

In [13]: draw()

In [14]: bars[1].set_visible(False)

In [15]: draw()

-------------------------------------------------------------------------
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