@@ -1827,12 +1827,17 @@ def plot_trisurf(self, *args, **kwargs):
1827
1827
lightsource = kwargs .pop ('lightsource' , None )
1828
1828
1829
1829
tri , args , kwargs = Triangulation .get_from_args_and_kwargs (* args , ** kwargs )
1830
- z = np .asarray (args [0 ])
1830
+ if 'Z' in kwargs :
1831
+ z = np .asarray (kwargs .pop ('Z' ))
1832
+ else :
1833
+ z = np .asarray (args [0 ])
1834
+ # We do this so Z doesn't get passed as an arg to PolyCollection
1835
+ args = args [1 :]
1831
1836
1832
1837
triangles = tri .get_masked_triangles ()
1833
- xt = tri .x [triangles ][...,np .newaxis ]
1834
- yt = tri .y [triangles ][...,np .newaxis ]
1835
- zt = np . array ( z ) [triangles ][...,np .newaxis ]
1838
+ xt = tri .x [triangles ][..., np .newaxis ]
1839
+ yt = tri .y [triangles ][..., np .newaxis ]
1840
+ zt = z [triangles ][..., np .newaxis ]
1836
1841
1837
1842
verts = np .concatenate ((xt , yt , zt ), axis = 2 )
1838
1843
@@ -2024,10 +2029,12 @@ def tricontour(self, *args, **kwargs):
2024
2029
* args , ** kwargs )
2025
2030
X = tri .x
2026
2031
Y = tri .y
2027
- Z = args [0 ]
2028
-
2029
- # We do this so Z doesn't get passed as an arg to Axes.tricontour
2030
- args = args [1 :]
2032
+ if 'Z' in kwargs :
2033
+ Z = kwargs .pop ('Z' )
2034
+ else :
2035
+ Z = args [0 ]
2036
+ # We do this so Z doesn't get passed as an arg to Axes.tricontour
2037
+ args = args [1 :]
2031
2038
2032
2039
jX , jY , jZ = art3d .rotate_axes (X , Y , Z , zdir )
2033
2040
tri = Triangulation (jX , jY , tri .triangles , tri .mask )
@@ -2109,10 +2116,12 @@ def tricontourf(self, *args, **kwargs):
2109
2116
* args , ** kwargs )
2110
2117
X = tri .x
2111
2118
Y = tri .y
2112
- Z = args [0 ]
2113
-
2114
- # We do this so Z doesn't get passed as an arg to Axes.tricontour
2115
- args = args [1 :]
2119
+ if 'Z' in kwargs :
2120
+ Z = kwargs .pop ('Z' )
2121
+ else :
2122
+ Z = args [0 ]
2123
+ # We do this so Z doesn't get passed as an arg to Axes.tricontourf
2124
+ args = args [1 :]
2116
2125
2117
2126
jX , jY , jZ = art3d .rotate_axes (X , Y , Z , zdir )
2118
2127
tri = Triangulation (jX , jY , tri .triangles , tri .mask )
0 commit comments