Changeset 2697 for trunk/python/asapplotter.py
- Timestamp:
- 12/14/12 13:48:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.