Box On/Off?

Hello John & NG,

    thank you very much for your answer. It seems to
me that using set_frame_on() just hides/shows the whole axes content.
Probably I didn't make myself clear (sorry for my bad english). I
attach a jpeg example of what I mean for bon on/off. The figure at the
left if with box "off", while at the right the box is "on".

Thanks in
advance.

Andrea.

I didn't know matlab had such a function, but it

looks from your

description like it corresponds to the frame_on

attribute of the

axes. You can turn the axes box off with, eg

ax

= subplot(111, frame_on=False)

or for an existing axes instance

ax.set_frame_on(False)

or with matlab-like handle graphics

setp

(ax, frame_on=False)

( you can get the current axes instance wih

gca() )

It just added a "box" wrapper function for pylab which
does

def box(on=None):
   """
   Turn the axes box on or off

according to 'on'

   If on is None, toggle state
   """
   ax =

gca()

   if on is None:
       on = not ax.get_frame_on()
   ax.

set_frame_on(on)

   draw_if_interactive()

which is now in CVS.

Let me know if this has the desired behavior...

box_on_off.jpg

···

JDH