redrawing map within gtk application

Hi all,

I'm trying to refresh a map within a gtk application everytime a button is pressed. But whatever I do, it doesn't work. Somehow I need to clear the axes. But even that doesn't work. A short hint what I'm missing would be great.

Here comes the reduced code:

#!/usr/bin/env python
import pygtk
import gtk

from matplotlib.figure import Figure
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
from mpl_toolkits.basemap import Basemap

class BGui:
     def destroy(self, widget, data=None):

     def change_zoom(self,button,zoom):

     def __init__(self):
         self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
         self.window.connect("destroy", self.destroy)
     self.zoom = 1.
         self.table = gtk.Table(2,1,True)
         self.table.attach(self.canvasMap, 0,1,0,1)
         self.button = gtk.Button("Change Zoom")
         self.button.connect("clicked", self.change_zoom, self.zoom+1.)

     def plot_map(self,zoom):
         print "plot_map called with zoom:" , zoom
         w = 1.2e6/zoom
         h = 1.2e6/zoom
         self.figMap = Figure()
         self.canvasMap = FigureCanvas(self.figMap) # a gtk.DrawingArea
         self.canvasMap.set_size_request(200, 200)
         self.axMap = self.figMap.add_axes([0.02, 0.02, 0.96, 0.96])
     #if hasattr(self,'map'):
       #print "clearing axes"
       #del( = Basemap(projection='tmerc', resolution='c',\
             lat_0=52., lon_0=9.5, width=w,height=h,ax=self.axMap)'green')

if __name__ == "__main__":
     bah = BGui()

Thanks in advance.




Dr. Mario Mech

Institute for Geophysics and Meteorology
University of Cologne
Zuelpicher Str. 49a
50674 Cologne

t: +49 (0)221 - 470 - 1776
f: +49 (0)221 - 470 - 5198
e: mech@...2927...