Changeset 2538
- Timestamp:
- 05/18/12 19:44:44 (13 years ago)
- Location:
- trunk/python
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapfitter.py
r2535 r2538 541 541 on the plot 542 542 """ 543 from matplotlib import rc as rcp 543 544 if not self.fitted: 544 545 return -
trunk/python/asaplot.py
r2483 r2538 26 26 self.window = None 27 27 self.canvas = FigureCanvasAgg(self.figure) 28 self.figmgr = FigureManagerBase(self.canvas, 1)28 self.figmgr = FigureManagerBase(self.canvas,0) 29 29 # This seems necessary when using Gcf, as this is done in 30 30 # pyplot.figure. Otherwise this can cause atexit errors at cleanup … … 32 32 self.figmgr._cidgcf = None 33 33 _pylab_helpers.Gcf.figs[self.figmgr.num] = self.figmgr 34 35 def quit(self): 36 # never dextroy non-GUI plotter. 37 pass 34 38 35 39 def map(self): -
trunk/python/asaplotbase.py
r2451 r2538 12 12 from matplotlib import rc, rcParams 13 13 from matplotlib.ticker import OldScalarFormatter 14 from matplotlib import _pylab_helpers 14 15 15 16 from asap.parameters import rcParams as asaprcParams … … 850 851 rotation=rotate,transform = trans) 851 852 self.axes.set_autoscale_on(True) 853 854 def _alive(self): 855 # Return True if the GUI alives. 856 if (not self.is_dead) and \ 857 self.figmgr and hasattr(self.figmgr, "num"): 858 figid = self.figmgr.num 859 # Make sure figid=0 is what asapplotter expects. 860 # It might be already destroied/overridden by matplotlib 861 # commands or other methods using asaplot. 862 return _pylab_helpers.Gcf.has_fignum(figid) and \ 863 (self.figmgr == _pylab_helpers.Gcf.get_fig_manager(figid)) 864 return False -
trunk/python/asapmath.py
r2535 r2538 3 3 from asap.logging import asaplog, asaplog_post_dec 4 4 from asap.selector import selector 5 #from asap import asaplotgui6 5 from asap.asapplotter import new_asaplot 6 from matplotlib import rc as rcp 7 7 8 8 @asaplog_post_dec -
trunk/python/asapplotter.py
r2535 r2538 140 140 when plot window is not alive. 141 141 """ 142 isAlive = (self._plotter != None and not self._plotter.is_dead)142 isAlive = (self._plotter is not None) and self._plotter._alive() 143 143 # More tests 144 if isAlive:145 if self._plotter.figmgr:146 figmgr = self._plotter.figmgr147 figid = figmgr.num148 # Make sure figid=0 is what asapplotter expects.149 # It might be already destroied/overridden by matplotlib150 # commands or other plotting methods using asaplot.151 isAlive = _pylab_helpers.Gcf.has_fignum(figid) and \152 (figmgr == \153 _pylab_helpers.Gcf.get_fig_manager(figid))154 else:155 isAlive = False144 #if isAlive: 145 # if self._plotter.figmgr: 146 # figmgr = self._plotter.figmgr 147 # figid = figmgr.num 148 # # Make sure figid=0 is what asapplotter expects. 149 # # It might be already destroied/overridden by matplotlib 150 # # commands or other plotting methods using asaplot. 151 # isAlive = _pylab_helpers.Gcf.has_fignum(figid) and \ 152 # (figmgr == \ 153 # _pylab_helpers.Gcf.get_fig_manager(figid)) 154 # else: 155 # isAlive = False 156 156 157 157 if isAlive: -
trunk/python/interactivemask.py
r2453 r2538 156 156 self.showmask = True 157 157 158 #if not self.p._plotter or self.p._plotter.is_dead:159 158 if not self.p: 160 159 asaplog.push('A new ASAP plotter will be loaded') … … 164 163 self.newplot = True 165 164 self.p._assert_plotter(action='reload') 165 from matplotlib import rc as rcp 166 rcp('lines', linewidth=1) 166 167 167 168 # Plot selected spectra if needed … … 339 340 if callback: self.callback=callback 340 341 if self.callback: self.callback() 341 if not self.event: self.p._plotter.register('button_press',None) 342 if not self.event: 343 try: self.p._plotter.register('button_press',None) 344 except: pass # plotter window is closed by X button. 342 345 # Finish the plot 343 346 if not self.newplot: 344 347 self.clear_polygon() 345 348 else: 346 self.p._plotter.unmap() 349 #self.p._plotter.unmap() 350 self.p._plotter.quit() 347 351 self.p._plotter = None 348 352 del self.p
Note:
See TracChangeset
for help on using the changeset viewer.