Changeset 1981 for trunk/python/asapplotter.py
- Timestamp:
- 01/28/11 17:34:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r1949 r1981 52 52 self._panellayout = self.set_panellayout(refresh=False) 53 53 self._offset = None 54 self._rowcount = 0 55 self._panelcnt = 0 54 self._startrow = 0 55 self._ipanel = -1 56 self._panelrows = [] 56 57 57 58 def _translate(self, instr): … … 96 97 are consistent e.g. all 'channel' or all 'velocity' etc. 97 98 """ 98 self._rowcount = self._panelcnt = 0 99 self._startrow = 0 100 self._ipanel = -1 99 101 if self._plotter.is_dead: 100 102 if hasattr(self._plotter.figmgr,'casabar'): … … 102 104 self._plotter = self._newplotter() 103 105 self._plotter.figmgr.casabar=self._newcasabar() 106 if self._plotter.figmgr.casabar: 107 self._plotter.figmgr.casabar.set_pagenum(1) 108 self._panelrows = [] 104 109 self._plotter.hold() 105 110 #self._plotter.clear() … … 361 366 if md == 'r': 362 367 self._stacking = '_r' 368 # you need to reset counters for multi page plotting 369 self._reset_counters() 363 370 return True 364 371 return False … … 396 403 if md == 'r': 397 404 self._panelling = '_r' 405 # you need to reset counters for multi page plotting 406 self._reset_counters() 398 407 return True 399 408 return False 409 410 def _reset_counters(self): 411 self._startrow = 0 412 self._ipanel = -1 413 self._panelrows = [] 400 414 401 415 def set_range(self,xstart=None,xend=None,ystart=None,yend=None,refresh=True, offset=None): … … 853 867 asaplog.post('WARN') 854 868 nstack = min(nstack,maxstack) 855 n = min(n,maxpanel) 869 #n = min(n,maxpanel) 870 n = min(n-self._ipanel-1,maxpanel) 856 871 857 872 if n > 1: … … 871 886 self._plotter.set_panels(layout=self._panellayout) 872 887 #r = 0 873 r = self._ rowcount888 r = self._startrow 874 889 nr = scan.nrow() 875 890 a0,b0 = -1,-1 876 891 allxlim = [] 877 892 allylim = [] 878 newpanel=True 893 #newpanel=True 894 newpanel=False 879 895 panelcount,stackcount = 0,0 896 # If this is not the first page 897 if r > 0: 898 # panelling value of the prev page 899 a0 = d[self._panelling](r-1) 900 # set the initial stackcount large not to plot 901 # the start row automatically 902 stackcount = nstack 903 880 904 while r < nr: 881 905 a = d[self._panelling](r) … … 906 930 stackcount = 0 907 931 panelcount += 1 932 # save the start row to plot this panel for future revisit. 933 if self._panelling != 'r' and \ 934 len(self._panelrows) < self._ipanel+1+panelcount: 935 self._panelrows += [r] 936 908 937 #if (b > b0 or newpanel) and stackcount < nstack: 909 938 if stackcount < nstack and (newpanel or (a == a0 and b > b0)): … … 954 983 allylim += ylim 955 984 stackcount += 1 985 a0=a 986 b0=b 956 987 # last in colour stack -> autoscale x 957 988 if stackcount == nstack and len(allxlim) > 0: … … 962 993 963 994 newpanel = False 964 a0=a965 b0=b995 #a0=a 996 #b0=b 966 997 # ignore following rows 967 if (panelcount == n ) and (stackcount == nstack):998 if (panelcount == n and stackcount == nstack) or (r == nr-1): 968 999 # last panel -> autoscale y if ganged 969 1000 if rcParams['plotter.ganged'] and len(allylim) > 0: … … 972 1003 break 973 1004 r+=1 # next row 974 ###-S 975 self._rowcount = r+1 976 self._panelcnt += panelcount 1005 1006 # save the current counter for multi-page plotting 1007 self._startrow = r+1 1008 self._ipanel += panelcount 977 1009 if self._plotter.figmgr.casabar: 978 if self._ panelcnt>= nptot-1:1010 if self._ipanel >= nptot-1: 979 1011 self._plotter.figmgr.casabar.disable_next() 980 1012 else: 981 1013 self._plotter.figmgr.casabar.enable_next() 982 #if self._panelcnt- panelcount > 0:983 #self._plotter.figmgr.casabar.enable_prev()984 #else:985 #self._plotter.figmgr.casabar.disable_prev()986 ###-E 1014 if self._ipanel + 1 - panelcount > 0: 1015 self._plotter.figmgr.casabar.enable_prev() 1016 else: 1017 self._plotter.figmgr.casabar.disable_prev() 1018 987 1019 #reset the selector to the scantable's original 988 1020 scan.set_selection(savesel)
Note: See TracChangeset
for help on using the changeset viewer.