imshow problem in matplot API?

In matplot examples,I have never find an image show with matplot API. I am
trying to do this. But fail again and again.

When I use pylab.imshow to show an image in the form of an array, it works
well. For example:

from pylab import *
array=ReadDem("data/testdem.txt").Array
'''
ReadDem is a class. From the statement, I can get an array in the following.
The array is store in testdem.txt.
[[ 7.65 5.69 8.46 7.69 7.46 7.69]
[ 8.65 6.69 5.46 5.69 5.46 7.69]
[ 6.65 7.69 7.46 6.69 8.46 5.69]
[ 8.65 9.69 5.46 5.69 5.46 7.69]
[ 5.65 5.69 7.46 5.69 6.46 7.69]
[ 8.65 5.69 5.46 8.69 8.46 7.69]]
'''
figure(1) # show image
im=imshow(array, interpolation='bilinear', origin='lower',cmap=cm.Blues)
show()

However, when I want to show it with matplot API,the following statements
fail.

import wx
from matplotlib.backends.backend_wx import FigureCanvasWx
from matplotlib.figure import Figure
from matplotlib.axes import *
from numpy import *

app=wx.PySimpleApp()
frame=wx.Frame(None,size=(600,600))
fig = Figure((6,4), 75)
canvas = FigureCanvasWx(frame, -1, fig)
ax=fig.add_axes([0.1,0.1,0.8,0.8])
array=ReadDem("data/testdem.txt").Array
ax.imshow(array)
frame.Show()
app.MainLoop()

Can someone help me? And make it work well. Thank you.

···


View this message in context: http://www.nabble.com/imshow-problem-in-matplot-API--tp15473270p15473270.html
Sent from the matplotlib - users mailing list archive at Nabble.com.