SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] How to show matplotlib.image ?

From: hjc520070 <jia...@16...> - 2007年11月30日 14:24:35
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---tf4912839.html#a14064300
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 によって変換されたページ (->オリジナル) /