Changeset 2861 for trunk/python
- Timestamp:
- 10/11/13 21:43:16 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/plotter2.py
r2860 r2861 588 588 self._plotter.get_vinfo() 589 589 590 def get_colorindex(self, colorname):591 """\592 (for internal use)590 @classmethod 591 def get_colorindex(cls, colorname): 592 """\ 593 593 convert the given color name into color index used in PGPLOT. 594 594 """ 595 595 name = colorname.strip().lower() 596 597 if name == "white": idx = 0 # our definition of bgcolor 598 if name == "black": idx = 1 # our definition of fgcolor 599 if name == "red": idx = 2 600 if name == "green": idx = 3 601 if name == "blue": idx = 4 602 if name == "cyan": idx = 5 603 if name == "magenta": idx = 6 604 if name == "yellow": idx = 7 605 if name == "orange": idx = 8 606 if name == "yellowgreen": idx = 9 607 if name == "emerald": idx = 10 608 if name == "skyblue": idx = 11 609 if name == "purple": idx = 12 610 if name == "pink": idx = 13 611 if name == "gray": idx = 14 612 if name == "lightgray": idx = 15 613 614 return idx 615 616 def list_colornames(self): 596 available_color = True 597 598 if name == "white": idx = 0 # our definition of bgcolor 599 elif name == "black": idx = 1 # our definition of fgcolor 600 elif name == "red": idx = 2 601 elif name == "green": idx = 3 602 elif name == "blue": idx = 4 603 elif name == "cyan": idx = 5 604 elif name == "magenta": idx = 6 605 elif name == "yellow": idx = 7 606 elif name == "orange": idx = 8 607 elif name == "yellowgreen": idx = 9 608 elif name == "emerald": idx = 10 609 elif name == "skyblue": idx = 11 610 elif name == "purple": idx = 12 611 elif name == "pink": idx = 13 612 elif name == "gray": idx = 14 613 elif name == "lightgray": idx = 15 614 else: available_color = False 615 616 if (available_color): 617 return idx 618 else: 619 raise ValueError("Unavailable colour name.") 620 621 @classmethod 622 def list_colornames(cls): 617 623 """\ 618 624 list the available color names. … … 637 643 print "---------------------------------" 638 644 639 def get_linestyleindex(self, fstyle):640 """\641 (for internal use)645 @classmethod 646 def get_linestyleindex(cls, fstyle): 647 """\ 642 648 convert the given line style into style index used in PGPLOT. 643 649 """ 644 650 style = fstyle.strip().lower() 645 if style == "solid": idx = 1 646 if style == "dashed": idx = 2 647 if style == "dash-dotted": idx = 3 648 if style == "dotted": idx = 4 649 if style == "dash-dot-dot-dotted": idx = 5 650 651 return idx 652 653 def list_linestyles(self): 651 available_style = True 652 653 if style == "solid": idx = 1 654 elif style == "dashed": idx = 2 655 elif style == "dash-dotted": idx = 3 656 elif style == "dotted": idx = 4 657 elif style == "dash-dot-dot-dotted": idx = 5 658 else: available_style = False 659 660 if (available_style): 661 return idx 662 else: 663 raise ValueError("Unavailable line style.") 664 665 @classmethod 666 def list_linestyles(cls): 654 667 """\ 655 668 list the available line styles. … … 663 676 print "------------------------------" 664 677 665 def get_fillstyleindex(self, fstyle):666 """\667 (for internal use)678 @classmethod 679 def get_fillstyleindex(cls, fstyle): 680 """\ 668 681 convert the given fill style into style index used in PGPLOT. 669 682 """ 670 683 style = fstyle.strip().lower() 671 if style == "solid": idx = 1 672 if style == "outline": idx = 2 673 if style == "hatched": idx = 3 674 if style == "crosshatched": idx = 4 675 676 return idx 677 678 def list_fillstyles(self): 684 available_style = True 685 686 if style == "solid": idx = 1 687 elif style == "outline": idx = 2 688 elif style == "hatched": idx = 3 689 elif style == "crosshatched": idx = 4 690 else: available_style = False 691 692 if (available_style): 693 return idx 694 else: 695 raise ValueError("Unavailable fill style.") 696 697 @classmethod 698 def list_fillstyles(cls): 679 699 """\ 680 700 list the available fill styles.
Note:
See TracChangeset
for help on using the changeset viewer.