pbs displaying images when embedded in Tkinter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

pbs displaying images when embedded in Tkinter

Hi all,

I'm having trouble displaying an image using the imshow() command in an embedded
TkinterCanvasAgg. I used mostly the examples embedding_in_tk2.py and

I use two code parts : in my __init__ for the gui def I have :

   self.mplfImageDisplay = mpl.figure.Figure(figsize=(5,4), dpi=100)
   #add tk.DrawingArea
   self.cvImageDisplay =
   #add toolbar
   toolbar = NavigationToolbar2TkAgg(self.cvImageDisplay,rightPaneImageDisplay)

then in one of my functions, if I use :

   a = self.mplfImageDisplay.add_subplot(111)
   a.contourf(x,y,self.scanformatdata,100)    #cmap=mpl.cm.gray)

This works fine, but now, I would like to display an image :

   a = mpl.image.FigureImage(na.asarray(self.scanformatdata))

This works but I can rescale the image not zoom in using the toolbar, so I tried
instead :

   a = mpl.axes.Axes(self.mplfImageDisplay,[0.1,1,0.1,1])

This does something but I don't know what since nothing is displayed...

Anyone has a clue ? Also, more generally speaking, I found quite extensive
documentation using the Pylab interface, but as soon as one moves away from
this (as when you need to if trying to embed in whatever backend, if i
understand well), then there doesn't exist much (?)... is there any source I
would have missed ?

All the best,


SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
Matplotlib-users mailing list
[hidden email]