Changeset 1824 for trunk/python/asapplotter.py
- Timestamp:
- 08/02/10 19:40:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapplotter.py
r1819 r1824 1 from asap import rcParams, print_log, print_log_dec 2 from asap import selector, scantable 3 from asap import asaplog 1 from asap.parameters import rcParams 2 from asap.selector import selector 3 from asap.scantable import scantable 4 from asap.logging import asaplog, print_log, print_log_dec 4 5 import matplotlib.axes 5 6 from matplotlib.font_manager import FontProperties … … 276 277 def set_data(self, scan, refresh=True): 277 278 """ 278 Set a scantable to plot. 279 Set a scantable to plot. 279 280 Parameters: 280 281 scan: a scantable 281 282 refresh: True (default) or False. If True, the plot is 282 replotted based on the new parameter setting(s). 283 replotted based on the new parameter setting(s). 283 284 Otherwise,the parameter(s) are set without replotting. 284 285 Note: 285 286 The user specified masks and data selections will be reset 286 287 if a new scantable is set. This method should be called before 287 setting data selections (set_selection) and/or masks (set_mask). 288 setting data selections (set_selection) and/or masks (set_mask). 288 289 """ 289 290 from asap import scantable … … 316 317 self._datamask = None 317 318 if refresh: self.plot() 318 319 319 320 320 321 def set_mode(self, stacking=None, panelling=None, refresh=True): … … 327 328 across multiple panels (default 'scan' 328 329 refresh: True (default) or False. If True, the plot is 329 replotted based on the new parameter setting(s). 330 replotted based on the new parameter setting(s). 330 331 Otherwise,the parameter(s) are set without replotting. 331 332 Note: … … 369 370 cols: The number of columns of plots 370 371 refresh: True (default) or False. If True, the plot is 371 replotted based on the new parameter setting(s). 372 replotted based on the new parameter setting(s). 372 373 Otherwise,the parameter(s) are set without replotting. 373 374 Note: … … 397 398 [x,y]start,[x,y]end: The start and end points of the 'zoom' window 398 399 refresh: True (default) or False. If True, the plot is 399 replotted based on the new parameter setting(s). 400 replotted based on the new parameter setting(s). 400 401 Otherwise,the parameter(s) are set without replotting. 401 402 Note: … … 440 441 10: center 441 442 refresh: True (default) or False. If True, the plot is 442 replotted based on the new parameter setting(s). 443 replotted based on the new parameter setting(s). 443 444 Otherwise,the parameter(s) are set without replotting. 444 445 … … 465 466 Parameters: 466 467 refresh: True (default) or False. If True, the plot is 467 replotted based on the new parameter setting(s). 468 replotted based on the new parameter setting(s). 468 469 Otherwise,the parameter(s) are set without replotting. 469 470 Example: … … 486 487 data determine the labels 487 488 refresh: True (default) or False. If True, the plot is 488 replotted based on the new parameter setting(s). 489 replotted based on the new parameter setting(s). 489 490 Otherwise,the parameter(s) are set without replotting. 490 491 Example: … … 508 509 data determine the labels 509 510 refresh: True (default) or False. If True, the plot is 510 replotted based on the new parameter setting(s). 511 replotted based on the new parameter setting(s). 511 512 Otherwise,the parameter(s) are set without replotting. 512 513 Example: … … 529 530 colmap: a list of colour names 530 531 refresh: True (default) or False. If True, the plot is 531 replotted based on the new parameter setting(s). 532 replotted based on the new parameter setting(s). 532 533 Otherwise,the parameter(s) are set without replotting. 533 534 Example: … … 553 554 plotter.histogram 554 555 refresh: True (default) or False. If True, the plot is 555 replotted based on the new parameter setting(s). 556 replotted based on the new parameter setting(s). 556 557 Otherwise,the parameter(s) are set without replotting. 557 558 """ … … 573 574 possible 574 575 refresh: True (default) or False. If True, the plot is 575 replotted based on the new parameter setting(s). 576 replotted based on the new parameter setting(s). 576 577 Otherwise,the parameter(s) are set without replotting. 577 578 Example: … … 600 601 seperately 601 602 refresh: True (default) or False. If True, the plot is 602 replotted based on the new parameter setting(s). 603 replotted based on the new parameter setting(s). 603 604 Otherwise,the parameter(s) are set without replotting. 604 605 """ … … 616 617 Parameters: 617 618 layout: a list of subplots layout in figure coordinate (0-1), 618 i.e., fraction of the figure width or height. 619 i.e., fraction of the figure width or height. 619 620 The order of elements should be: 620 621 [left, bottom, right, top, horizontal space btw panels, 621 vertical space btw panels]. 622 vertical space btw panels]. 622 623 refresh: True (default) or False. If True, the plot is 623 replotted based on the new parameter setting(s). 624 replotted based on the new parameter setting(s). 624 625 Otherwise,the parameter(s) are set without replotting. 625 626 Note 626 627 * When layout is not specified, the values are reset to the defaults 627 628 of matplotlib. 628 * If any element is set to be None, the current value is adopted. 629 * If any element is set to be None, the current value is adopted. 629 630 """ 630 631 if layout == []: self._panellayout=self._reset_panellayout() 631 else: 632 else: 632 633 self._panellayout=[None]*6 633 634 self._panellayout[0:len(layout)]=layout … … 744 745 selection: the spectra to apply the mask to. 745 746 refresh: True (default) or False. If True, the plot is 746 replotted based on the new parameter setting(s). 747 replotted based on the new parameter setting(s). 747 748 Otherwise,the parameter(s) are set without replotting. 748 749 Example: … … 961 962 #reset the selector to the scantable's original 962 963 scan.set_selection(savesel) 963 964 964 965 #temporary switch-off for older matplotlib 965 966 #if self._fp is not None: … … 973 974 selection: a selector object (default unset the selection) 974 975 refresh: True (default) or False. If True, the plot is 975 replotted based on the new parameter setting(s). 976 replotted based on the new parameter setting(s). 976 977 Otherwise,the parameter(s) are set without replotting. 977 978 """ … … 1049 1050 PL.gcf().subplots_adjust(left=lef,bottom=bot,right=rig,top=top, 1050 1051 wspace=wsp,hspace=hsp) 1051 1052 1052 1053 tdel = max(t) - min(t) 1053 1054 ax = PL.subplot(2,1,1) … … 1271 1272 print data (scantable) header on the plot and/or logger. 1272 1273 Parameters: 1273 plot: whether or not print header info on the plot. 1274 plot: whether or not print header info on the plot. 1274 1275 fontsize: header font size (valid only plot=True) 1275 1276 autoscale: whether or not autoscale the plot (valid only plot=True) … … 1280 1281 if not plot and not logger: return 1281 1282 if not self._data: raise RuntimeError("No scantable has been set yet.") 1282 # Now header will be printed on plot and/or logger. 1283 # Get header information and format it. 1283 # Now header will be printed on plot and/or logger. 1284 # Get header information and format it. 1284 1285 ssum=self._data.__str__() 1285 1286 # Print Observation header to the upper-left corner of plot … … 1293 1294 headstr.append(ssel) 1294 1295 nstcol=len(headstr) 1295 1296 1296 1297 self._plotter.hold() 1297 1298 for i in range(nstcol): … … 1314 1315 print_log() 1315 1316 del ssum 1316 1317
Note: See TracChangeset
for help on using the changeset viewer.