Ignore:
Timestamp:
03/18/11 15:51:14 (13 years ago)
Author:
Kana Sugimoto
Message:

New Development: No (a bug fix)

JIRA Issue: Yes (CAS-2764, ATNF-238)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: added asapplotter.clear_header method to clear plotted header.

Test Programs: plot spectra without header and go back and forth the pages. you should not see header plotted anymore.

Put in Release Notes: No

Module(s): asapplotter, sdplot

Description:

Fixed a bug which I introduced yesterday.
Header information is not printed on a plotter when you don't mean to plot it.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/casatoolbar.py

    r2051 r2053  
    182182    def _new_page(self,goback=False):
    183183        top = None
     184        header = self.plotter._headtext
     185        reset = False
     186        doheader = (isinstance(header['textobj'],list) and \
     187                    len(header['textobj']) > 0)
    184188        if self.plotter._startrow <= 0:
    185189            msg = "The page counter is reset due to chages of plot settings. "
     
    187191            asaplog.push(msg)
    188192            asaplog.post('WARN')
     193            reset = True
    189194            goback = False
    190         else:
     195            if doheader:
     196                extrastr = selstr = ''
     197                if header.has_key('extrastr'):
     198                    extrastr = header['extrastr']
     199                if header.has_key('selstr'):
     200                    selstr = header['selstr']
     201            self.plotter._reset_header()
     202        if doheader:
    191203            top = self.plotter._plotter.figure.subplotpars.top
     204            fontsize = header['textobj'][0].get_fontproperties().get_size()
    192205
    193206        self.plotter._plotter.hold()
     
    197210        self.plotter._plot(self.plotter._data)
    198211        self.set_pagecounter(self._get_pagenum())
    199         self.plotter._plotter.release()
    200         self.plotter._plotter.tidy()
    201         if self.plotter._headstring:
     212        # Plot header information
     213        if header['textobj']:
    202214            if top and top != self.plotter._margins[3]:
    203215                # work around for sdplot in CASA. complete checking in future?
    204216                self.plotter._plotter.figure.subplots_adjust(top=top)
    205             self.plotter.print_header()
     217            if reset:
     218                self.plotter.print_header(plot=True,fontsize=fontsize,selstr=selstr, extrastr=extrastr)
     219            else:
     220                self.plotter._header_plot(header['string'],fontsize=fontsize)
     221        self.plotter._plotter.release()
     222        self.plotter._plotter.tidy()
    206223        self.plotter._plotter.show(hardrefresh=False)
    207224        del top
Note: See TracChangeset for help on using the changeset viewer.