Troubles with WX backend

Hi Eugene,

I've had a quick look into the problem for you, and I can't give an immediate
solution, but I'll try to get a fix in the next few days.

I can say that in the original design, the intention was that show() would be
the last line of any script. I know that John (author of virtually everything
in Matplotlib except backend_wx) has recently made some changes to allow
show() to be called more than once.

Unfortunately, the code needed to do thisis quite specific to each GUI
library, and I cannot simply port what has been done for GTK (I've just tried
something very close to the GTK implementation, and it doesn't work).

A few questions for John Hunter:
I think I need to do something like the following:
- show() must now instantiate any figures already defined and enter the the
main event loop. ShowOn needs to keep track of this.
- I need to keep track of the number of figures instantiated. I assume that
Gcf.destroy() does this.
- I need to ensure that I do not exit when the last figure is destroyed, and
therefore need to manage that I may need to create a new figure manager if
there is none.

Have I missed anything?

Regards

Jeremy

Eugene A. Suchkov writes:

···

Hi all!

There are some bug's I've found in two days I got started with echotag.

1) I can't make 2 plots using WX-backend sequentially

For example:

---CODE---

import matplotlib
matplotlib.use('WX')
from matplotlib.matlab import *
plot([1,2,3,4])
show()
plot([1,4,9,16])
show()

--END CODE--

Well, everything is OK, while building 1st graph, but then an error
occurs:

--OUTPUT--

Traceback (most recent call last):
  File "plot.py", line 7, in ?
    plot([1,4,9,16])
  File "/usr/lib/python2.2/site-packages/matplotlib/matlab.py", line
723, in plot draw_if_interactive()
  File
"/usr/lib/python2.2/site-packages/matplotlib/backends/backend_wx.py",
line 986, in draw_if_interactive current_fig =
Gcf().get_current_figwin().figure AttributeError: 'Gcf' object has no
attribute 'get_current_figwin'

--END OUTPUT--
It was tested on Linux and Windows. Versions 0.40 and 0.32

When I'm using GTK everything is OK with both graphs, but using WX is
critical :frowning: