I just want to show a matplotlib.image.AxesImage on a figure. But It can't work properly. Can somebody help me? The code are following: when I run it , It just show a white figure. But I Set it cm.Greens .It doesn't work . Why?
# -*- coding:gb2312 -*- import matplotlib matplotlib.use("WXAgg") matplotlib.interactive(True) from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure from matplotlib.axes import Subplot from numpy import * import wx class ShowPlot(): def __init__(self,Frame): delta = 0.025 x = arange(-2.0, 2.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((6,6), 70) self.canvas = FigureCanvasWx(Frame, -1, self.fig) self.axe=self.fig.add_axes([0.1, 0.1, 0.8, 0.8]) i=matplotlib.image.AxesImage(self.axe,data=Z,interpolation='bilinear', origin='lower',cmap=cm.Greens, extent=(-2,2,-2,2)) app = wx.PySimpleApp() f=wx.Frame(None,size=(600,600)) f.Show(True) ShowPlot(f) app.MainLoop() -- View this message in context: http://www.nabble.com/matplotlib.image.AxesImage-can%27t-work.-tf4897267.html#a14025951 Sent from the matplotlib - devel mailing list archive at Nabble.com. ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel