Changeset 257


Ignore:
Timestamp:
01/21/05 22:28:02 (19 years ago)
Author:
mar637
Message:

*renaming in scantable
*added custom x/y axis labels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r226 r257  
    3939        self._lmap = []
    4040        self._title = None
     41        self._ordinate = None
     42        self._abcissa = None
    4143
    4244    def _translate(self, name):
     
    106108                        tlab = scan._getsourcename(i)                   
    107109                x,xlab = scan.get_abcissa(i)
    108                 y = scan.getspectrum(i)
    109                 ylab = 'Flux ('+scan.get_fluxunit()+')'
    110                 m = scan.getmask(i)
     110                if self._abcissa: xlab = self._abcissa
     111                y = scan._getspectrum(i)
     112                if self._ordinate:
     113                    ylab = self._ordinate
     114                else:
     115                    ylab = 'Flux ('+scan.get_fluxunit()+')'
     116                m = scan._getmask(i)
    111117                if self._lmap and len(self._lmap) > 0:
    112118                    llab = self._lmap[j]
     
    149155                    tlab = scan._getsourcename()
    150156                x,xlab = scan.get_abcissa()
    151                 y = scan.getspectrum()
    152                 ylab = 'Flux ('+scan.get_fluxunit()+')'
    153                 m = scan.getmask()
    154                 if len(self._lmap) > 0:
     157                if self._abcissa: xlab = self._abcissa
     158                y = scan._getspectrum()
     159                if self._ordinate:
     160                    ylab = self._ordinate
     161                else:
     162                    ylab = 'Flux ('+scan.get_fluxunit()+')'
     163                m = scan._getmask()
     164                if self._lmap and len(self._lmap) > 0:
    155165                    llab = self._lmap[j]
    156166                else:
     
    186196                self._plotter.palette(0)
    187197            k=0
    188             j=i
     198            #j=i
    189199            eval(cdict.get(self._panels))
    190200            for j in range(ncol):
     
    199209                m = None
    200210                x,xlab = scan.get_abcissa(k)
    201                 y = scan.getspectrum(k)
    202                 ylab = 'Flux ('+scan.get_fluxunit()+')'
    203                 m = scan.getmask(k)
     211                if self._abcissa: xlab = self._abcissa
     212                y = scan._getspectrum(k)
     213                if self._ordinate:
     214                    ylab = self._ordinate
     215                else:
     216                    ylab = 'Flux ('+scan.get_fluxunit()+')'
     217                m = scan._getmask(k)
    204218                if colmode == 's' or colmode == 't':
    205219                    if not self._title:
     
    213227                else:
    214228                    if self._title and len(self._title) > 0:
    215                         tlab = self._title[k]
     229                        tlab = self._title[i]
    216230                    else:
    217                         tlab = scan._getsourcename(k)
     231                        tlab = self._ldict.get(self._panels)+' '+str(i)
    218232                    if self._lmap and len(self._lmap) > 0:
    219233                        llab = self._lmap[j]
     
    294308        return
    295309   
    296     def set_legend_map(self, mp=[]):
     310    def set_legend(self, mp=None):
    297311        """
    298312        Specify a mapping for the legend instead of using the default
     
    319333        return
    320334
     335    def set_ordinate(self, ordinate=None):
     336        self._ordinate = ordinate
     337        if self._data: self.plot()
     338        return
     339
     340    def set_abcissa(self, abcissa=None):
     341        self._abcissa = abcissa
     342        if self._data: self.plot()
     343        return
     344
     345       
     346
    321347if __name__ == '__main__':
    322348    plotter = asapplotter()
Note: See TracChangeset for help on using the changeset viewer.