Changeset 7516
- Timestamp:
- Sep 18, 2009, 2:08:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/polygon.py
r7511 r7516 695 695 figname=None, 696 696 label=None, 697 alpha=None, 697 698 verbose=False): 698 699 """ Take list of polygons and plot. … … 709 710 figname - name to save figure to 710 711 711 label - title for plot 712 label - title for plotA 713 714 alpha - transparency of polygon fill, 0.0=none, 1.0=solid 715 if not supplied, no fill. 712 716 713 717 Outputs: … … 718 722 719 723 from pylab import ion, hold, plot, axis, figure, legend, savefig, xlabel, \ 720 ylabel, title, close, title 724 ylabel, title, close, title, fill 721 725 722 726 assert type(polygons_points) == list, \ … … 733 737 if label is None: 734 738 label = '' 739 740 # clamp alpha to sensible range 741 if alpha: 742 try: 743 alpha = float(alpha) 744 except ValueError: 745 alpha = None 746 else: 747 if alpha < 0.0: 748 alpha = 0.0 749 if alpha > 1.0: 750 alpha = 1.0 735 751 736 752 n = len(polygons_points) … … 757 773 if max(y) > maxy: maxy = max(y) 758 774 plot(x,y,colour[i]) 775 if alpha: 776 fill(x, y, colour[i], alpha=alpha) 759 777 xlabel('x') 760 778 ylabel('y')
Note: See TracChangeset
for help on using the changeset viewer.