Changeset 1556 for trunk/python


Ignore:
Timestamp:
03/30/09 14:40:55 (16 years ago)
Author:
Malte Marquarding
Message:

Fix for ticket #158; can' use rc parameters to set fonts dynamically

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1555 r1556  
    11from asap import rcParams, print_log, selector, scantable
    22import matplotlib.axes
     3from matplotlib.font_manager import FontProperties
     4from matplotlib.text import Text
     5
    36import re
    47
     
    3841        self._selection = selector()
    3942        self._hist = rcParams['plotter.histogram']
     43        self._fp = FontProperties()
    4044
    4145    def _translate(self, instr):
     
    489493            if v:
    490494                fdict[k] = v
    491         rcp('font', **fdict)
     495        self._fp = FontProperties(**fdict)
    492496        if self._data:
    493             self.plot(self._data)
     497            self.plot()
    494498
    495499    def plot_lines(self, linecat=None, doppler=0.0, deltachan=10, rotate=90.0,
     
    787791        #reset the selector to the scantable's original
    788792        scan.set_selection(savesel)
     793        if self._fp is not None:
     794            for o in self._plotter.figure.findobj(Text):
     795                o.set_fontproperties(self._fp)
     796
    789797
    790798    def set_selection(self, selection=None, refresh=True):
     
    823831        return userlabel or d[mode]
    824832
    825     def plotazel(self, scan=None):
     833    def plotazel(self):
    826834        """
    827835        plot azimuth and elevation  versus time of a scantable
     
    831839        from matplotlib.ticker import MultipleLocator
    832840        from matplotlib.numerix import array, pi
    833         self._data = scan
    834         dates = self._data.get_time()
     841        dates = self._data.get_time(asdatetime=True)
    835842        t = PL.date2num(dates)
    836843        tz = timezone('UTC')
     
    893900        PL.draw()
    894901
    895     def plotpointing(self, scan=None):
     902    def plotpointing(self):
    896903        """
    897904        plot telescope pointings
     
    901908        from matplotlib.ticker import MultipleLocator
    902909        from matplotlib.numerix import array, pi, zeros
    903         self._data = scan
    904910        dir = array(self._data.get_directionval()).transpose()
    905911        ra = dir[0]*180./pi
Note: See TracChangeset for help on using the changeset viewer.