Changeset 1724


Ignore:
Timestamp:
04/21/10 20:42:50 (15 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-1801)

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed: two classes, CustomToolbarTkAgg and CustomToolbarCommon,

are created to a new module casatoolbar

Test Programs: run sdplot with plottype='spectra' and 'totalpower'

Put in Release Notes: Yes/No

Module(s): CASA task sdplot, sdbaseline, sdstat, sdfit

Description:

Two new classes, CustomToolbarTkAgg and CustomToolbarCommon, are
created to a new module casatoolbar in order to remove backend dependency
of sdplot(). The other code are modified accordingly.
The additional toolbar, casabar, is now default in ASAP plotter
(asapplotter.plot and asapplotter.plottp).


Location:
branches/alma/python
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/python/asapplotter.py

    r1723 r1724  
    1818            self._visible = visible
    1919        self._plotter = self._newplotter()
     20        if self._visible and matplotlib.get_backend() == "TkAgg":
     21            from asap.casatoolbar import CustomToolbarTkAgg
     22            self._plotter.figmgr.casabar = CustomToolbarTkAgg(self)
    2023
    2124        self._panelling = None
     
    5053
    5154    def _newplotter(self):
    52         if self._visible:
     55        backend=matplotlib.get_backend()
     56        if not self._visible:
     57            from asap.asaplot import asaplot
     58        elif backend == 'TkAgg':
    5359            from asap.asaplotgui import asaplotgui as asaplot
     60        elif backend == 'Qt4Agg':
     61            from asap.asaplotgui_qt4 import asaplotgui as asaplot
     62        elif backend == 'GTkAgg':
     63            from asap.asaplotgui_gtk import asaplotgui as asaplot
    5464        else:
    5565            from asap.asaplot import asaplot
     
    8494        if self._minmaxy is not None:
    8595            self._plotter.set_limits(ylim=self._minmaxy)
     96        if self._plotter.figmgr.casabar: self._plotter.figmgr.casabar.enable_button()
    8697        self._plotter.release()
    8798        self._plotter.tidy()
     
    10371048        self._plotter.figure.subplots_adjust(
    10381049            left=lef,bottom=bot,right=rig,top=top,wspace=wsp,hspace=hsp)
     1050        if self._plotter.figmgr.casabar: self._plotter.figmgr.casabar.disable_button()
    10391051        self._plottp(self._data)
    10401052        if self._minmaxy is not None:
     
    11531165            print_log()
    11541166        del ssum
     1167
     1168
  • branches/alma/python/interactivemask.py

    r1667 r1724  
    159159                        # Need replot
    160160                        self.p.plot(self.scan)
     161                        # disable casa toolbar
     162                        if self.p._plotter.figmgr.casabar:  self.p._plotter.figmgr.casabar.disable_button()
    161163                        for panel in self.p._plotter.subplots:
    162164                                xmin, xmax = panel['axes'].get_xlim()
Note: See TracChangeset for help on using the changeset viewer.