File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2098,8 +2098,10 @@ def _convert_mesh_to_triangles(self, coordinates):
2098
2098
], axis = 2 ).reshape ((- 1 , 3 , 2 ))
2099
2099
2100
2100
c = self .get_facecolor ().reshape ((* coordinates .shape [:2 ], 4 ))
2101
- mask = c [..., 3 ] == 0
2102
- c [mask , 3 ] = np .nan
2101
+ z = self .get_array ()
2102
+ mask = z .mask if np .ma .is_masked (z ) else None
2103
+ if mask is not None :
2104
+ c [mask , 3 ] = np .nan
2103
2105
c_a = c [:- 1 , :- 1 ]
2104
2106
c_b = c [:- 1 , 1 :]
2105
2107
c_c = c [1 :, 1 :]
@@ -2111,8 +2113,8 @@ def _convert_mesh_to_triangles(self, coordinates):
2111
2113
c_c , c_d , c_center ,
2112
2114
c_d , c_a , c_center ,
2113
2115
], axis = 2 ).reshape ((- 1 , 3 , 4 ))
2114
- mask = np .isnan (colors [..., 2 , 3 ])
2115
- return triangles [~ mask ], colors [~ mask ]
2116
+ tmask = np .isnan (colors [..., 2 , 3 ])
2117
+ return triangles [~ tmask ], colors [~ tmask ]
2116
2118
2117
2119
@artist .allow_rasterization
2118
2120
def draw (self , renderer ):
You can’t perform that action at this time.
0 commit comments