Changeset 377
- Timestamp:
- 02/08/05 09:22:34 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r282 r377 7 7 By default the plotter is set up to plot polarisations 8 8 'colour stacked' and scantables across panels. 9 The defaul plotter is called 'plotter'.10 9 Note: 11 10 Currenly it only plots 'spectra' not Tsys or … … 34 33 self._panels = 's' 35 34 self._stacking = rcParams['plotter.stacking'] 35 self._rows = None 36 self._cols = None 36 37 self._autoplot = False 37 38 self._minmax = None … … 90 91 self._plotter.set_panels() 91 92 if n > 1: 92 self._plotter.set_panels(rows=n) 93 if self._rows and self._cols: 94 n = min(n,self._rows*self._cols) 95 self._plotter.set_panels(rows=self._rows,cols=self._cols, 96 nplots=n) 97 else: 98 self._plotter.set_panels(rows=n,cols=0) 93 99 for i in range(n): 94 100 if n > 1: 95 self._plotter.palette( 0)101 self._plotter.palette(1) 96 102 self._plotter.subplot(i) 97 103 for j in range(ncol): … … 140 146 self._plotter.set_panels() 141 147 if n > 1: 142 self._plotter.set_panels(rows=n) 148 if self._rows and self._cols: 149 n = min(n,self._rows*self._cols) 150 self._plotter.set_panels(rows=self._rows,cols=self._cols, 151 nplots=n) 152 else: 153 self._plotter.set_panels(rows=n,cols=0) 143 154 i = 0 144 155 for scan in scans: … … 190 201 self._plotter.set_panels() 191 202 if n > 1: 192 self._plotter.set_panels(rows=n) 203 if self._rows and self._cols: 204 n = min(n,self._rows*self._cols) 205 self._plotter.set_panels(rows=self._rows,cols=self._cols, 206 nplots=n) 207 else: 208 self._plotter.set_panels(rows=n,cols=0) 193 209 for i in range(n): 194 210 if n>1: … … 248 264 def set_mode(self, stacking=None, panelling=None): 249 265 """ 266 Set the plots look and feel, i.e. what you want to see on the plot. 250 267 Parameters: 251 268 stacking: tell the plotter which variable to plot … … 270 287 return 271 288 272 def set_panels(self, what=None): 289 def set_panels(self, what=None): 290 """ 291 """ 273 292 if not what: 274 293 what = rcParams['plotter.panelling'] … … 279 298 return True 280 299 return False 300 301 def set_layout(self,rows=None,cols=None): 302 """ 303 Set the multi-panel layout, i.e. how many rows and columns plots 304 are visible. 305 Parameters: 306 rows: The number of rows of plots 307 cols: The number of columns of plots 308 Note: 309 If no argument is given, the potter reverts to its auto-plot 310 behaviour. 311 """ 312 self._rows = rows 313 self._cols = cols 314 if self._data: self.plot() 315 return 281 316 282 317 def set_stacking(self, what=None): … … 343 378 return 344 379 345 380 def save(self, filename=None): 381 """ 382 Save the plot to a file. The know formats are 'png', 'ps', 'eps'. 383 Parameters: 384 filename: The name of the output file. This is optional 385 and autodetects the image format from the file 386 suffix. If non filename is specified a file 387 called 'yyyymmdd_hhmmss.png' is created in the 388 current directory. 389 """ 390 self._plotter.save(filename) 391 return 346 392 347 393 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.