title: TkInter Matplotlib Basemap in FigureCanvasTkAgg
body: <p>I'm trying to add a Matplotlib Basemap to a TkInter Canvas. It works fine not using a basemap, however, when I try to plot one Python crashes. Code block #1 is the code which works, Code block #2 makes my program crash. If I delete everything in #2 except the <code>m=Basemap(...)</code>part it crashes also. Calculating the <code>Basemap(...)</code> takes about 6 or 7 seconds and I guess that is the reason for TkInter to crash. Any ideas how I can tell TkInter to wait?</p>
  
  <h1>1:</h1>
  
  <pre><code>def plot_route(self, geom1, root):
              root1 = Tk()
  
              x1, y1 = zip(*((geom1.GetX(i), geom1.GetY(i)) for i in range(geom1.GetPointCount())))
              f = Figure(figsize=(5,4), dpi=100)
              a = f.add_subplot(111)
              a.plot(x1,y1)
              a.set_title('Tk embedding')
              a.set_xlabel('X axis label')
              a.set_ylabel('Y label')
  
              canvas = FigureCanvasTkAgg(f, master=root1)
              canvas.show()
              canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1)
              canvas._tkcanvas.pack(side=TOP, fill=BOTH, expand=1)
  
              root1.mainloop()
  </code></pre>
  
  <h1>2:</h1>
  
  <pre><code>def plot_route(self, geom1, root):
              root1 = Tk()
  
              m = Basemap(width=12000000,height=9000000,projection='lcc', resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
              m.drawcoastlines()
              m.drawmapboundary(fill_color='aqua')
              m.fillcontinents(color='coral',lake_color='aqua')
  
              canvas = FigureCanvasTkAgg(m, master=root1)
              canvas.show()
              canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1)
              canvas._tkcanvas.pack(side=TOP, fill=BOTH, expand=1)
  
              root1.mainloop()
  </code></pre>