The following run well . But I just want to make the image, with the x and y
as axis and z as the image value ,show on the figure. In the pylab , we can
just give a command "imshow" ,But here , I fail to do it , I have try
ax.imshow() again and again ,but fail. Can sb give me some advice . Thank
you .
import matplotlib
matplotlib.use("WXAgg")
matplotlib.interactive(True)
from matplotlib.backends.backend_wx import FigureCanvasWx
from matplotlib.figure import Figure
from matplotlib.axes import *
from numpy import *
import wx
from pylab import *
···
#---------------------------------------------------
class DynamicPlot():
def __init__(self,Frame):
delta = 0.025
x = arange(-3.0, 3.0, delta)
y = arange(-2.0, 2.0, delta)
X, Y = meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = 10.0 * (Z2 - Z1)
levels = arange(-1.2, 1.6, 0.2)
self.fig = Figure((8,8), 75)
self.canvas = FigureCanvasWx(Frame, -1, self.fig)
ax=self.fig.add_axes([0.1,0.1,0.8,0.8])
ax.contour(X,Y,Z,levels,origin='lower',linewidths=2,extent=(-3,3,-2,2))
app = wx.PySimpleApp()
f=wx.Frame(None,size=(600,600))
f.Show(True)
DynamicPlot(f)
app.MainLoop()
–
View this message in context: http://www.nabble.com/How-to-show-matplotlib.image---tf4930297.html#a14111799
Sent from the matplotlib - users mailing list archive at Nabble.com.