Gcf, ShowOn

On Tue, 18 Nov 2003, John Hunter wrote: JH: JH:Good to

    > hear -- I think the code is becoming much cleaner. Even
    > I JH:understand the way _matlab_helpers and Gcf works
    > now!

    > I might need a hand there. I had a script that used to
    > use the ShowOn method directly, but that isn't working
    > now, and I'm not quite sure what's the right thing to do.

Is this with CVS or version 0.32? I just tested the CVS version in
interactive mode (interactive2.py) and it worked; I am not sure right
now what trouble you are having. I'd like to clear up the bug so let
me know anything you can (version info) and if possible an example
script.

    > I'm trying to maintain a figure on my own, without having
    > a call to show(). I used to be able to set ShowOn to 1,
    > queue draw events as needed, and update the display every
    > few seconds on my own with calls to gtk_mainiteration().

As a workaround, is it possible to use the backend_gtk Figure class
directly

  from matplotlib.backends_gtk import FigureGTK

  fig = Figure(figsize=(5,4), dpi=100)
  ax = Subplot(fig, 111) # <<<- new API in CVS

Then you can do away with 'show' and 'ShowOn' altogether and use the
GTK tools directly. See the embedding_in_gtk.py and
embedding_in_gtk2.py (new in CVS) if you want to use the toolbar.

BTW, excepting the wx backend which Jeremy is still porting to the
last frontend change, CVS is now in very good shape with no known
bugs, and does a much better job of precise layout (ticklabel
positioning, tick sizes, legend placement, etc, by virtue of the new
transform system). The untrained eye may not notice a difference. So
if you are not using CVS you may want to consider it (cvs mirror may
need some time to update). I also would like as much testing as
possible before 0.40. For users, there are few significant changes

  - figure sizes and relative text sizes will appear different (as
    discussed before) but this is stabilizing. Eg, I don't anticipate
    significant changes in future releases

  - If you use the OO API directly, init Axes, Subplot with fig
    instances. If you create your own Line2D, or Rectangle, or other
    artists, you need to init them with a dpi instance, bbox, and x
    and y transformations. See the header in the transforms module.

(for a complete list of API changes, see axes.py). I'll spell this
out in greater detail in the actual release.

JDH