Changeset 9072 for trunk/anuga_core
- Timestamp:
- Apr 9, 2014, 8:04:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/utilities/plot_utils.py
r9068 r9072 777 777 return 778 778 779 def plot_triangles(p ):779 def plot_triangles(p, adjustLowerLeft=False): 780 780 """ Add mesh triangles to a pyplot plot 781 781 """ 782 782 from matplotlib import pyplot as pyplot 783 # 784 x0=p.xllcorner 785 x1=p.yllcorner 786 # 783 787 for i in range(len(p.vols)): 784 788 k1=p.vols[i][0] 785 789 k2=p.vols[i][1] 786 790 k3=p.vols[i][2] 787 pyplot.plot([p.x[k1], p.x[k2], p.x[k3], p.x[k1]], [p.y[k1], p.y[k2], p.y[k3], p.y[k1]],'-',color='black') 791 if(!adjustLowerLeft): 792 pyplot.plot([p.x[k1], p.x[k2], p.x[k3], p.x[k1]], [p.y[k1], p.y[k2], p.y[k3], p.y[k1]],'-',color='black') 793 else: 794 pyplot.plot([p.x[k1]+x0, p.x[k2]+x0, p.x[k3]+x0, p.x[k1]+x0], [p.y[k1]+x1, p.y[k2]+x1, p.y[k3]+x1, p.y[k1]+x1],'-',color='black') 788 795 #pyplot.plot([p.x[k3], p.x[k2]], [p.y[k3], p.y[k2]],'-',color='black') 789 796 #pyplot.plot([p.x[k3], p.x[k1]], [p.y[k3], p.y[k1]],'-',color='black')
Note: See TracChangeset
for help on using the changeset viewer.