Changeset 2715 for trunk/python
- Timestamp:
- 01/07/13 19:29:32 (12 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotbase.py
r2700 r2715 9 9 from matplotlib.figure import Figure, Text 10 10 from matplotlib.font_manager import FontProperties as FP 11 from numpy import sqrt 11 from numpy import sqrt, ceil 12 12 from matplotlib import rc, rcParams 13 13 from matplotlib.ticker import OldScalarFormatter … … 100 100 return False 101 101 102 def _subplotsOk(self, rows, cols, npanel=0): 103 """ 104 Check if the axes in subplots are actually the ones plotted on 105 the figure. Returns a bool. 106 This method is to detect manual layout changes using mpl methods. 107 """ 108 # compare with user defined layout 109 if (rows is not None) and (rows != self.rows): 110 return False 111 if (cols is not None) and (cols != self.cols): 112 return False 113 # check number of subplots 114 figaxes = self.figure.get_axes() 115 np = self.rows*self.cols 116 if npanel > np: 117 return False 118 if len(figaxes) != np: 119 return False 120 if len(self.subplots) != len(figaxes): 121 return False 122 # compare axes instance in this class and on the plotter 123 ok = True 124 for ip in range(np): 125 if self.subplots[ip]['axes'] != figaxes[ip]: 126 ok = False 127 break 128 return ok 102 129 103 130 ### Delete artists ### -
trunk/python/asapplotter.py
r2714 r2715 517 517 self._rows = rows 518 518 self._cols = cols 519 # new layout is set. need to reset counters for multi page plotting 520 self._reset_counters() 519 521 if refresh and self._data: self.plot(self._data) 520 522 return … … 949 951 self._startrow = 0 950 952 self._ipanel = -1 953 self._panelrows = [] 951 954 self._reset_header() 952 self._panelrows = []953 955 if self.casabar_exists(): 954 956 self._plotter.figmgr.casabar.set_pagecounter(1) … … 1042 1044 if self._panelling == 'i': 1043 1045 ganged = False 1044 if not firstpage: 1045 # not the first page just clear the axis 1046 if (not firstpage) and \ 1047 self._plotter._subplotsOk(self._rows, self._cols, n): 1048 # Not the first page and subplot number is ok. 1049 # Just clear the axis 1046 1050 nx = self._plotter.cols 1047 1051 ipaxx = n - nx - 1 #the max panel id to supress x-label
Note:
See TracChangeset
for help on using the changeset viewer.