Changeset 2697 for trunk/python
- Timestamp:
- 12/14/12 13:48:22 (12 years ago)
- Location:
- trunk/python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotbase.py
r2693 r2697 94 94 """ 95 95 96 for i in range(len(self.lines)):97 self.delete(i)96 #for i in range(len(self.lines)): 97 # self.delete(i) 98 98 self.axes.clear() 99 99 self.color = 0 100 100 self.lines = [] 101 self.subplots[self.i]['lines'] = self.lines 101 102 102 103 def palette(self, color, colormap=None, linestyle=0, linestyles=None): -
trunk/python/asapplotter.py
r2694 r2697 193 193 msg = "Input is not a scantable" 194 194 raise TypeError(msg) 195 self._startrow = 0196 self._ipanel = -1197 self._reset_header()198 self._panelrows = []199 195 200 196 self._assert_plotter(action="reload") 201 if self.casabar_exists():202 self._plotter.figmgr.casabar.set_pagecounter(1)203 204 197 self._plotter.hold() 198 self._reset_counter() 205 199 #self._plotter.clear() 206 200 if scan: … … 969 963 self._headtext={'string': None, 'textobj': None} 970 964 965 def _reset_counter(self): 966 self._startrow = 0 967 self._ipanel = -1 968 self._reset_header() 969 self._panelrows = [] 970 if self.casabar_exists(): 971 self._plotter.figmgr.casabar.set_pagecounter(1) 972 971 973 def _plot(self, scan): 972 974 savesel = scan.get_selection() … … 1004 1006 #n = min(n-self._ipanel-1,maxpanel) 1005 1007 n = n-self._ipanel-1 1006 1007 ganged = False 1008 if n > 1: 1009 ganged = rcParams['plotter.ganged'] 1010 if self._panelling == 'i': 1011 ganged = False 1012 if self._rows and self._cols: 1013 n = min(n,self._rows*self._cols) 1008 # the number of panels in this page 1009 if self._rows and self._cols: 1010 n = min(n,self._rows*self._cols) 1011 else: 1012 n = min(n,maxpanel) 1013 1014 firstpage = (self._ipanel < 0) 1015 #ganged = False 1016 ganged = rcParams['plotter.ganged'] 1017 if self._panelling == 'i': 1018 ganged = False 1019 if not firstpage: 1020 # not the first page just clear the axis 1021 nx = self._plotter.cols 1022 ipaxx = n - nx - 1 #the max panel id to supress x-label 1023 for ip in xrange(len(self._plotter.subplots)): 1024 self._plotter.subplot(ip) 1025 self._plotter.clear() 1026 self._plotter.axes.set_visible((ip<n)) 1027 if ganged: 1028 self._plotter.axes.xaxis.label.set_visible((ip > ipaxx)) 1029 if ip <= ipaxx: 1030 map(lambda x: x.set_visible(False), \ 1031 self._plotter.axes.get_xticklabels()) 1032 self._plotter.axes.yaxis.label.set_visible((ip % nx)==0) 1033 if ip % nx: 1034 map(lambda y: y.set_visible(False), \ 1035 self._plotter.axes.get_yticklabels()) 1036 elif (n > 1 and self._rows and self._cols): 1014 1037 self._plotter.set_panels(rows=self._rows,cols=self._cols, 1015 1038 nplots=n,margin=self._margins, 1016 1039 ganged=ganged) 1017 else:1018 n = min(n,maxpanel)1019 self._plotter.set_panels(rows=n,cols=0,nplots=n,1020 margin=self._margins,ganged=ganged)1021 1040 else: 1022 self._plotter.set_panels(margin=self._margins) 1041 self._plotter.set_panels(rows=n,cols=0,nplots=n, 1042 margin=self._margins,ganged=ganged) 1023 1043 #r = 0 1024 1044 r = self._startrow … … 1172 1192 if self._fp is not None and getattr(self._plotter.figure,'findobj',False): 1173 1193 for o in self._plotter.figure.findobj(Text): 1174 o.set_fontproperties(self._fp) 1194 if not self._headtext['textobj'] or \ 1195 not (o in self._headtext['textobj']): 1196 o.set_fontproperties(self._fp) 1175 1197 1176 1198 def _get_sortstring(self, lorders): … … 1400 1422 self._assert_plotter(action="reload") 1401 1423 self._plotter.hold() 1424 self._reset_counter() 1402 1425 if self.casabar_exists(): 1403 self._plotter.figmgr.casabar.set_pagecounter(1)1404 1426 self._plotter.figmgr.casabar.disable_button() 1405 1427 # for now, only one plot … … 1667 1689 self._plotter.hold() 1668 1690 self._header_plot(headstr,fontsize=fontsize) 1669 import time1670 self._plotter.figure.text(0.99,0.01,1671 time.strftime("%a %d %b %Y %H:%M:%S %Z"),1672 horizontalalignment='right',1673 verticalalignment='bottom',fontsize=8)1691 #import time 1692 #self._plotter.figure.text(0.99,0.01, 1693 # time.strftime("%a %d %b %Y %H:%M:%S %Z"), 1694 # horizontalalignment='right', 1695 # verticalalignment='bottom',fontsize=8) 1674 1696 self._plotter.release() 1675 1697 if logger: … … 1867 1889 self._assert_plotter(action="reload") 1868 1890 self._plotter.hold() 1869 #self._plotter.clear() #all artists are cleared at set_panels1891 self._reset_counter() 1870 1892 self._plotter.legend() 1871 1893 … … 1876 1898 nplots=ntotpl,margin=self._margins,ganged=True) 1877 1899 if self.casabar_exists(): 1878 self._plotter.figmgr.casabar.set_pagecounter(1)1879 1900 self._plotter.figmgr.casabar.enable_button() 1880 1901 # Plot helper -
trunk/python/customgui_base.py
r2606 r2697 326 326 doheader = (isinstance(header['textobj'],list) and \ 327 327 len(header['textobj']) > 0) 328 if doheader: 329 top = self.plotter._plotter.figure.subplotpars.top 330 fontsize = header['textobj'][0].get_fontproperties().get_size() 328 331 if self.plotter._startrow <= 0: 329 332 msg = "The page counter is reset due to chages of plot settings. " … … 340 343 selstr = header['selstr'] 341 344 self.plotter._reset_header() 342 if doheader:343 top = self.plotter._plotter.figure.subplotpars.top344 fontsize = header['textobj'][0].get_fontproperties().get_size()345 345 346 346 self.plotter._plotter.hold() … … 349 349 #self.plotter._plotter.clear() 350 350 self.plotter._plot(self.plotter._data) 351 self.set_pagecounter(self._get_pagenum()) 351 pagenum = self._get_pagenum() 352 self.set_pagecounter(pagenum) 352 353 # Plot header information 353 if header['textobj']: 354 #if header['textobj']: 355 if doheader and pagenum == 1: 354 356 if top and top != self.plotter._margins[3]: 355 357 # work around for sdplot in CASA. complete checking in future? … … 403 405 404 406 def _get_pagenum(self): 405 maxpanel = 16406 407 # get the ID of last panel in the current page 407 408 idlastpanel = self.plotter._ipanel 408 if self.plotter._rows and self.plotter._cols: 409 ppp = self.plotter._rows*self.plotter._cols 410 else: 411 ppp = maxpanel 409 # max panels in a page 410 ppp = self.plotter._plotter.rows*self.plotter._plotter.cols 412 411 return int(idlastpanel/ppp)+1 413 412 … … 1239 1238 1240 1239 def _get_pagenum(self): 1241 maxpanel = 251242 1240 # get the ID of last panel in the current page 1243 1241 idlastpanel = self.plotter._ipanel 1244 if self.plotter._rows and self.plotter._cols: 1245 ppp = self.plotter._rows*self.plotter._cols 1246 else: 1247 ppp = maxpanel 1242 # max panels in a page 1243 ppp = self.plotter._plotter.rows*self.plotter._plotter.cols 1248 1244 return int(idlastpanel/ppp)+1 1249 1245
Note:
See TracChangeset
for help on using the changeset viewer.