Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

added default mappable to None

This commit is contained in:
Arnar Flatberg 2007-04-24 17:16:34 +00:00
parent 31ac569c3e
commit 90bb25eb55
1 changed files with 2 additions and 4 deletions

View File

@ -40,6 +40,7 @@ class Plot(view.View):
# init matplotlib related stuff # init matplotlib related stuff
self._background = None self._background = None
self._colorbar = None self._colorbar = None
self._mappable = None
self._use_blit = False self._use_blit = False
self.fig = Figure() self.fig = Figure()
self.canvas = FigureCanvasGTKAgg(self.fig) self.canvas = FigureCanvasGTKAgg(self.fig)
@ -136,11 +137,8 @@ class Plot(view.View):
def _toggle_colorbar(self): def _toggle_colorbar(self):
if self._colorbar == None: if self._colorbar == None:
# get last created instance of mappable
if not self._mappable:
self._mappable = matplotlib.pylab.gci()
if self._mappable == None: if self._mappable == None:
print "No mappable" logger.log('notice', 'No mappable in this plot')
return return
if self._mappable._A != None: # we need colormapping if self._mappable._A != None: # we need colormapping
# get axes original position # get axes original position