Changeset 2909 for trunk/python
- Timestamp:
- 03/24/14 17:32:50 (11 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/plotter2.py
r2896 r2909 545 545 def set_arrow(self, xtail, xhead, ytail, yhead, color=None, width=None, linestyle=None, headsize=None, headfs=None, headangle=None, headvent=None, vpid=None, arrowid=None): 546 546 """\ 547 appendan arrow or change existing arrow attributes.547 draw an arrow or change existing arrow attributes. 548 548 549 549 Parameters: … … 589 589 self._plotter.set_arrow(xtail, xhead, ytail, yhead, coloridx, width, linestyleidx, headsize, headfsidx, headangle, headvent, vpid, arrowid) 590 590 591 def set_annotation(self, label, posx=None, posy=None, angle=None, fjust=None, size=None, style=None, color=None, bgcolor=None, vpid=None, annid=None): 592 if posx is None: posx = 0.5 593 if posy is None: posy = 0.5 591 def set_text(self, text, posx=None, posy=None, angle=None, fjust=None, size=None, style=None, color=None, bgcolor=None, vpid=None, textid=None): 592 """\ 593 write text string or change existing text attributes. 594 595 Parameters: 596 text: text string. 597 posx: x position of text in world coordinate. 598 default is center of x axis. 599 posy: y position of text in world coordinate. 600 default is center of y axis. 601 angle: rotation angle of text in unit of degree. 602 0.0 (default) is horizontal. 603 fjust: horizontal justification of text string. if 0.0 604 (default) is given, the text is left-justified at 605 (posx, posy). if 0.5, the text is centered, and if 606 1.0, the text is right-justified. 607 size: size of text string. the default is 1.0. 608 style: font style. "normal", "roman", "italic" and "script" 609 are available. default is "normal". 610 color: color of text. see output of list_colornames(). 611 default is "black". 612 bgcolor: background color of text. see output of 613 list_colornames(). default is transparent(-1). 614 vpid: viewport id. when not given, the last viewport will 615 be the target. 616 textid: text id independently defined for each viewport. 617 when not given, the text having the final text id 618 for the specified viewport will be the target. 619 """ 620 if posx is None: posx = -1.0 621 if posy is None: posy = -1.0 594 622 if angle is None: angle = 0.0 595 if fjust is None: fjust = 0. 5623 if fjust is None: fjust = 0.0 596 624 if size is None: size = 1.0 597 625 if style is None: style = "" … … 599 627 if bgcolor is None: bgcolor = "" # transparent 600 628 if vpid is None: vpid = -1 601 if annid is None: annid= -1629 if textid is None: textid = -1 602 630 603 631 coloridx = self.get_colorindex(color) 604 bgcoloridx = self.get_colorindex(bgcolor) if (bgcolor.strip() != "") else bgcolor605 606 self._plotter.set_ annotation(label, posx, posy, angle, fjust, size, style, coloridx, bgcoloridx, vpid, annid)632 bgcoloridx = self.get_colorindex(bgcolor) if (bgcolor.strip() != "") else -1 #bgcolor 633 634 self._plotter.set_text(text, posx, posy, angle, fjust, size, style, coloridx, bgcoloridx, vpid, textid) 607 635 608 636 def set_xlabel(self, label, style=None, size=None, posx=None, posy=None, vpid=None): … … 620 648 posx: x position of label string in window coordinate. 621 649 default is the center of x axis. 622 posy: y position of label string .650 posy: y position of label string in window coordinate. 623 651 vpid: viewport id. when not given, the last viewport 624 652 will be the target. … … 645 673 of number labels) 646 674 posx: x position of label string in window coordinate. 647 posy: y position of label string .675 posy: y position of label string in window coordinate. 648 676 default is the center of y axis. 649 677 vpid: viewport id. when not given, the last viewport -
trunk/python/scantable.py
r2902 r2909 2053 2053 pmin = 0.0 2054 2054 pmax = float(self.nchan(spw) - 1) 2055 2056 molid = self._getmolidcol_list()[self.get_first_rowno_by_if(spw)] 2055 2057 2056 2058 if (len(colon_sep) == 1): … … 2110 2112 elif is_number(expr0) and is_velocity(expr1): 2111 2113 # 'a~b*m/s' 2112 restf = self.get_restfreqs() .values()[0][0]2114 restf = self.get_restfreqs()[molid][0] 2113 2115 (expr_v0, expr_v1) = get_velocity_by_string(expr0, expr1) 2114 2116 dppl = self.get_doppler()
Note:
See TracChangeset
for help on using the changeset viewer.