Changeset 9690
- Timestamp:
- Feb 25, 2015, 9:32:56 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/utilities/plot_utils.py
r9660 r9690 1166 1166 k2=p.vols[i][1] 1167 1167 k3=p.vols[i][2] 1168 if not adjustLowerLeft: 1169 vertices.append([ [p.x[k1], p.y[k1]], [p.x[k2], p.y[k2]], [p.x[k3], p.y[k3]] ]) 1170 else: 1171 vertices.append([ [p.x[k1]+x0, p.y[k1]+y0], [p.x[k2]+x0, p.y[k2]+y0], [p.x[k3]+x0, p.y[k3]+y0] ]) 1168 1169 tri_coords = numpy.array([ [p.x[k1], p.y[k1]], [p.x[k2], p.y[k2]], [p.x[k3], p.y[k3]] ]) 1170 if adjustLowerLeft: 1171 tri_coords[:,0] = tri_coords[:,0] + x0 1172 tri_coords[:,1] = tri_coords[:,1] + y0 1173 1174 vertices.append(tri_coords) 1172 1175 1173 1176 # Make PolyCollection 1174 1177 if values is None: 1175 all_poly = PolyCollection( vertices, array = numpy.zeros(len( p.vols)),1178 all_poly = PolyCollection( vertices, array = numpy.zeros(len(vertices)), 1176 1179 edgecolors=edgecolors) 1177 1180 all_poly.set_facecolor('none') 1178 1181 else: 1179 assert len(values)==len(p.vols), 'len(values) must either be 1, or the same as len(p.vols)' 1180 all_poly = PolyCollection( vertices, array = values, cmap = values_cmap, edgecolors=edgecolors) 1182 msg = 'len(values) must either be 1, or the same as len(p.vols)' 1183 assert len(values)==len(p.vols), msg 1184 all_poly = PolyCollection( vertices, array = values, cmap = values_cmap, 1185 edgecolors=edgecolors) 1181 1186 1182 1187 # Add to plot
Note: See TracChangeset
for help on using the changeset viewer.