Changeset 1023
- Timestamp:
- 04/19/06 11:43:15 (19 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotbase.py
r1020 r1023 139 139 140 140 141 def hist(self, x=None, y=None, fmt=None):141 def hist(self, x=None, y=None, msk=None, fmt=None, add=None): 142 142 """ 143 143 Plot a histogram. N.B. the x values refer to the start of the … … 149 149 if x is None: 150 150 if y is None: return 151 x = range( 0,len(y))151 x = range(len(y)) 152 152 153 153 if len(x) != len(y): 154 154 return 155 156 155 l2 = 2*len(x) 157 x2 = range(0,l2) 158 y2 = range(0,l2) 159 160 for i in range(0,l2): 156 x2 = range(l2) 157 y2 = range(l2) 158 m2 = range(l2) 159 160 for i in range(l2): 161 161 x2[i] = x[i/2] 162 163 y2[0] = 0 162 m2[i] = msk[i/2] 163 164 y2[0] = 0.0 164 165 for i in range(1,l2): 165 166 y2[i] = y[(i-1)/2] 166 167 167 self.plot(x2, y2, fmt)168 self.plot(x2, y2, m2, fmt, add) 168 169 169 170 -
trunk/python/asapplotter.py
r1021 r1023 37 37 self._maskselection = None 38 38 self._selection = selector() 39 self._hist = None 40 if rcParams['plotter.histogram']: self._hist = "steps" 41 else: self._hist = "-" 42 39 self._hist = rcParams['plotter.histogram'] 40 43 41 def _translate(self, instr): 44 42 keys = "s b i p t".split() … … 272 270 plotter.histogram 273 271 """ 274 if hist: self._hist = "steps" 275 else: self._hist = "-" 276 if self._data: self.plot(self._data) 277 272 self._hist = hist 273 if self._data: self.plot(self._data) 274 278 275 def set_linestyles(self, linestyles): 279 276 """ … … 478 475 llbl = self._get_label(scan, r, self._stacking, None) 479 476 self._plotter.set_line(label=llbl) 480 self._plotter.set_line(linestyle=self._hist) 481 self._plotter.plot(x,y,m) 477 plotit = self._plotter.plot 478 if self._hist: plotit = self._plotter.hist 479 plotit(x,y,m) 482 480 xlim= self._minmaxx or [min(x),max(x)] 483 481 allxlim += xlim
Note:
See TracChangeset
for help on using the changeset viewer.