Can a window generated by another module be triggered from within a
wxpython app window?
If not, can anyone make a suggestion as to how I might go about this
differently using
wx natives.
I was trying to launch the following function from a button within my wx app:
def showGraph(self, event):
print 'Graph.showGraph function accessed'
import matplotlib
from pylab import figure, show, rand
from matplotlib.patches import Ellipse
NUM = 1
#ells = [Ellipse(x =, y =, width = 2, height = 7, angle = 360)]
#ells2 = list(Ellipse(x = 20, y = 40, width = 2, height = 7, angle = 360))
ells2 = [Ellipse(xy=rand(2), width=rand(), height=rand(),
angle=rand()*360)for i in xrange(NUM)]
fig = figure()
ax = fig.add_subplot(111, aspect='equal')
for e in ells2:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
e.set_alpha(4)
e.set_facecolor(rand(3))
x = 7
return x
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
show()
At first I received an error(can't remember what it was related to,
but I think it was in relation to matplotlib.use('Agg'))
that matplotlib.backend was already selected.
So is the cause that the show() function from pylab uses something
different to generate it's menu, and the two can't tango?
TIA,
David
Newbie forget use:
http://www.google.com/search?q=wxpython+matplotlib&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a
···
On Sat, Sep 25, 2010 at 1:18 PM, David Hutto <smokefloat@gmail.com> wrote:
Can a window generated by another module be triggered from within a
wxpython app window?
If not, can anyone make a suggestion as to how I might go about this
differently using
wx natives.
I was trying to launch the following function from a button within my wx app:
def showGraph(self, event):
print 'Graph.showGraph function accessed'
import matplotlib
from pylab import figure, show, rand
from matplotlib.patches import Ellipse
NUM = 1
\#ells = \[Ellipse\(x =, y =, width = 2, height = 7, angle = 360\)\]
\#ells2 = list\(Ellipse\(x = 20, y = 40, width = 2, height = 7, angle = 360\)\)
ells2 = \[Ellipse\(xy=rand\(2\), width=rand\(\), height=rand\(\),
angle=rand()*360)for i in xrange(NUM)]
fig = figure()
ax = fig.add_subplot(111, aspect='equal')
for e in ells2:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
e.set_alpha(4)
e.set_facecolor(rand(3))
x = 7
return x
ax\.set\_xlim\(0, 10\)
ax\.set\_ylim\(0, 10\)
show\(\)
At first I received an error(can't remember what it was related to,
but I think it was in relation to matplotlib.use('Agg'))
that matplotlib.backend was already selected.
So is the cause that the show() function from pylab uses something
different to generate it's menu, and the two can't tango?
TIA,
David