Skip to content

Commit 2c06a95

Browse files
committed
Modify tripcolor_demo to show new gouraud shading.
1 parent 74bf315 commit 2c06a95

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

examples/pylab_examples/tripcolor_demo.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@
3535
# pcolor plot.
3636
plt.figure()
3737
plt.gca().set_aspect('equal')
38-
plt.tripcolor(triang, z, shading='faceted')
38+
plt.tripcolor(triang, z, shading='flat')
3939
plt.colorbar()
40-
plt.title('tripcolor of Delaunay triangulation')
40+
plt.title('tripcolor of Delaunay triangulation: flat')
41+
42+
# Illustrate Gouraud shading.
43+
plt.figure()
44+
plt.gca().set_aspect('equal')
45+
plt.tripcolor(triang, z, shading='gouraud')
46+
plt.colorbar()
47+
plt.title('tripcolor with Gouraud shading')
4148

4249

4350
# You can specify your own triangulation rather than perform a Delaunay
@@ -89,7 +96,7 @@
8996
# calculations.
9097
plt.figure()
9198
plt.gca().set_aspect('equal')
92-
plt.tripcolor(x, y, triangles, z, shading='faceted')
99+
plt.tripcolor(x, y, triangles, z, shading='flat', edgecolors='k')
93100
plt.colorbar()
94101
plt.title('tripcolor of user-specified triangulation')
95102
plt.xlabel('Longitude (degrees)')

0 commit comments

Comments
 (0)