SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] matplotlib.image.AxesImage can't work.

From: hjc520070 <jia...@16...> - 2007年11月30日 13:35:21
Thank u for your help. I did it as your reply. But some questions appear
again . Can you give me some more advice , your help will be appreciated.
Code are as following: You know when I do "self.ax.images.append(self.im)"
in pylab . It do properly , But ,it fail here. Thank you!
# -*- 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 *
from numpy import *
import wx
from matplotlib.image import NonUniformImage
import numpy as npy
 
#---------------------------------------------------
class DynamicPlot():
 def __init__(self,Frame):
 x = npy.arange(-4, 4, 0.005)
 y = npy.arange(-4, 4, 0.005)
 z = npy.sqrt(x[npy.newaxis,:]**2 + y[:,npy.newaxis]**2)
 
 self.fig = Figure((8,8), 75)
 self.canvas = FigureCanvasWx(Frame, -1, self.fig)
 self.ax=self.fig.add_subplot(111)
 self.im = NonUniformImage(self.ax)
 self.im.set_data(x, y, z)
 self.ax.images.append(self.im)
 self.ax.imshow(self.im)
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/matplotlib.image.AxesImage-can%27t-work.-tf4897267.html#a14057748
Sent from the matplotlib - devel mailing list archive at Nabble.com.

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /