Ignore:
Timestamp:
05/18/12 19:44:44 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (related to CAS-3749)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: added a new method, _alive(), in asaplotbase class

Test Programs: Interactive tests

Put in Release Notes: No

Module(s):

Description:

Added a new method, _alive(), in asaplotbase class. The method return True
if asaplot instance is alive. More complete check compared to 'is_dead' parameter.
asapplotter._assert_plotter method is simplified by calling this function.

Fixed misc bugs found in interactive tests.

  1. set back linewidth = 1 in plots invoked by modules, interactivemask, asapmath, and asapfitter.
  2. interactivemask module: plotter in properly quited at the end.
  3. interactivemask module: avoid error when user close interacive plot window before calling the finalization method, finish_selection().
  4. added definition of a dummy function, quit(), in asaplot class.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotbase.py

    r2451 r2538  
    1212from matplotlib import rc, rcParams
    1313from matplotlib.ticker import OldScalarFormatter
     14from matplotlib import _pylab_helpers
    1415
    1516from asap.parameters import rcParams as asaprcParams
     
    850851                    rotation=rotate,transform = trans)
    851852        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
Note: See TracChangeset for help on using the changeset viewer.