@@ -120,8 +120,9 @@ def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
120
120
raise ValueError (
121
121
"shading='gouraud' can only be used when the colors "
122
122
"are specified at the points, not at the faces." )
123
- collection = TriMesh (tri , ** kwargs )
124
- colors = point_colors
123
+ _api .check_isinstance ((Normalize , None ), norm = norm )
124
+ collection = TriMesh (tri , alpha = alpha , array = point_colors ,
125
+ cmap = cmap , norm = norm , ** kwargs )
125
126
else :
126
127
# Vertices of triangles.
127
128
maskedTris = tri .get_masked_triangles ()
@@ -137,13 +138,10 @@ def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
137
138
else :
138
139
colors = facecolors
139
140
140
- collection = PolyCollection (verts , ** kwargs )
141
+ _api .check_isinstance ((Normalize , None ), norm = norm )
142
+ collection = PolyCollection (verts , alpha = alpha , array = colors ,
143
+ cmap = cmap , norm = norm , ** kwargs )
141
144
142
- collection .set_alpha (alpha )
143
- collection .set_array (colors )
144
- _api .check_isinstance ((Normalize , None ), norm = norm )
145
- collection .set_cmap (cmap )
146
- collection .set_norm (norm )
147
145
collection ._scale_norm (norm , vmin , vmax )
148
146
ax .grid (False )
149
147
0 commit comments