19
19
20
20
import numpy as np
21
21
22
- from matplotlib import _api , cbook , docstring
22
+ from matplotlib import _api , cbook , docstring , _preprocess_data
23
23
import matplotlib .artist as martist
24
24
import matplotlib .axes as maxes
25
25
import matplotlib .collections as mcoll
@@ -2075,6 +2075,7 @@ def add_contourf_set(self, cset, zdir='z', offset=None):
2075
2075
art3d .poly_collection_2d_to_3d (linec , z , zdir = zdir )
2076
2076
linec .set_sort_zpos (z )
2077
2077
2078
+ @_preprocess_data ()
2078
2079
def contour (self , X , Y , Z , * args ,
2079
2080
extend3d = False , stride = 5 , zdir = 'z' , offset = None , ** kwargs ):
2080
2081
"""
@@ -2093,6 +2094,9 @@ def contour(self, X, Y, Z, *args,
2093
2094
offset : float, optional
2094
2095
If specified, plot a projection of the contour lines at this
2095
2096
position in a plane normal to zdir.
2097
+ data : indexable object, optional
2098
+ DATA_PARAMETER_PLACEHOLDER
2099
+
2096
2100
*args, **kwargs
2097
2101
Other arguments are forwarded to `matplotlib.axes.Axes.contour`.
2098
2102
@@ -2111,6 +2115,7 @@ def contour(self, X, Y, Z, *args,
2111
2115
2112
2116
contour3D = contour
2113
2117
2118
+ @_preprocess_data ()
2114
2119
def tricontour (self , * args ,
2115
2120
extend3d = False , stride = 5 , zdir = 'z' , offset = None , ** kwargs ):
2116
2121
"""
@@ -2133,6 +2138,8 @@ def tricontour(self, *args,
2133
2138
offset : float, optional
2134
2139
If specified, plot a projection of the contour lines at this
2135
2140
position in a plane normal to zdir.
2141
+ data : indexable object, optional
2142
+ DATA_PARAMETER_PLACEHOLDER
2136
2143
*args, **kwargs
2137
2144
Other arguments are forwarded to `matplotlib.axes.Axes.tricontour`.
2138
2145
@@ -2161,6 +2168,7 @@ def tricontour(self, *args,
2161
2168
self .auto_scale_xyz (X , Y , Z , had_data )
2162
2169
return cset
2163
2170
2171
+ @_preprocess_data ()
2164
2172
def contourf (self , X , Y , Z , * args , zdir = 'z' , offset = None , ** kwargs ):
2165
2173
"""
2166
2174
Create a 3D filled contour plot.
@@ -2174,6 +2182,8 @@ def contourf(self, X, Y, Z, *args, zdir='z', offset=None, **kwargs):
2174
2182
offset : float, optional
2175
2183
If specified, plot a projection of the contour lines at this
2176
2184
position in a plane normal to zdir.
2185
+ data : indexable object, optional
2186
+ DATA_PARAMETER_PLACEHOLDER
2177
2187
*args, **kwargs
2178
2188
Other arguments are forwarded to `matplotlib.axes.Axes.contourf`.
2179
2189
@@ -2192,6 +2202,7 @@ def contourf(self, X, Y, Z, *args, zdir='z', offset=None, **kwargs):
2192
2202
2193
2203
contourf3D = contourf
2194
2204
2205
+ @_preprocess_data ()
2195
2206
def tricontourf (self , * args , zdir = 'z' , offset = None , ** kwargs ):
2196
2207
"""
2197
2208
Create a 3D filled contour plot.
@@ -2209,6 +2220,8 @@ def tricontourf(self, *args, zdir='z', offset=None, **kwargs):
2209
2220
offset : float, optional
2210
2221
If specified, plot a projection of the contour lines at this
2211
2222
position in a plane normal to zdir.
2223
+ data : indexable object, optional
2224
+ DATA_PARAMETER_PLACEHOLDER
2212
2225
*args, **kwargs
2213
2226
Other arguments are forwarded to
2214
2227
`matplotlib.axes.Axes.tricontourf`.
@@ -2271,6 +2284,9 @@ def add_collection3d(self, col, zs=0, zdir='z'):
2271
2284
collection = super ().add_collection (col )
2272
2285
return collection
2273
2286
2287
+ @_preprocess_data (replace_names = ["xs" , "ys" , "zs" , "s" ,
2288
+ "edgecolors" , "c" , "facecolor" ,
2289
+ "facecolors" , "color" ])
2274
2290
def scatter (self , xs , ys , zs = 0 , zdir = 'z' , s = 20 , c = None , depthshade = True ,
2275
2291
* args , ** kwargs ):
2276
2292
"""
@@ -2308,6 +2324,8 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
2308
2324
Whether to shade the scatter markers to give the appearance of
2309
2325
depth. Each call to ``scatter()`` will perform its depthshading
2310
2326
independently.
2327
+ data : indexable object, optional
2328
+ DATA_PARAMETER_PLACEHOLDER
2311
2329
**kwargs
2312
2330
All other arguments are passed on to `~.axes.Axes.scatter`.
2313
2331
@@ -2342,6 +2360,7 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c=None, depthshade=True,
2342
2360
2343
2361
scatter3D = scatter
2344
2362
2363
+ @_preprocess_data ()
2345
2364
def bar (self , left , height , zs = 0 , zdir = 'z' , * args , ** kwargs ):
2346
2365
"""
2347
2366
Add 2D bar(s).
@@ -2357,6 +2376,8 @@ def bar(self, left, height, zs=0, zdir='z', *args, **kwargs):
2357
2376
used for all bars.
2358
2377
zdir : {'x', 'y', 'z'}, default: 'z'
2359
2378
When plotting 2D data, the direction to use as z ('x', 'y' or 'z').
2379
+ data : indexable object, optional
2380
+ DATA_PARAMETER_PLACEHOLDER
2360
2381
**kwargs
2361
2382
Other arguments are forwarded to `matplotlib.axes.Axes.bar`.
2362
2383
@@ -2393,6 +2414,7 @@ def bar(self, left, height, zs=0, zdir='z', *args, **kwargs):
2393
2414
2394
2415
return patches
2395
2416
2417
+ @_preprocess_data ()
2396
2418
def bar3d (self , x , y , z , dx , dy , dz , color = None ,
2397
2419
zsort = 'average' , shade = True , lightsource = None , * args , ** kwargs ):
2398
2420
"""
@@ -2441,6 +2463,9 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
2441
2463
lightsource : `~matplotlib.colors.LightSource`
2442
2464
The lightsource to use when *shade* is True.
2443
2465
2466
+ data : indexable object, optional
2467
+ DATA_PARAMETER_PLACEHOLDER
2468
+
2444
2469
**kwargs
2445
2470
Any additional keyword arguments are passed onto
2446
2471
`~.art3d.Poly3DCollection`.
@@ -2562,6 +2587,7 @@ def set_title(self, label, fontdict=None, loc='center', **kwargs):
2562
2587
self .title .set_y (0.92 * y )
2563
2588
return ret
2564
2589
2590
+ @_preprocess_data ()
2565
2591
def quiver (self , * args ,
2566
2592
length = 1 , arrow_length_ratio = .3 , pivot = 'tail' , normalize = False ,
2567
2593
** kwargs ):
@@ -2599,6 +2625,9 @@ def quiver(self, *args,
2599
2625
Whether all arrows are normalized to have the same length, or keep
2600
2626
the lengths defined by *u*, *v*, and *w*.
2601
2627
2628
+ data : indexable object, optional
2629
+ DATA_PARAMETER_PLACEHOLDER
2630
+
2602
2631
**kwargs
2603
2632
Any additional keyword arguments are delegated to
2604
2633
:class:`~matplotlib.collections.LineCollection`
@@ -2927,6 +2956,7 @@ def permutation_matrices(n):
2927
2956
2928
2957
return polygons
2929
2958
2959
+ @_preprocess_data (replace_names = ["x" , "y" , "z" , "xerr" , "yerr" , "zerr" ])
2930
2960
def errorbar (self , x , y , z , zerr = None , yerr = None , xerr = None , fmt = '' ,
2931
2961
barsabove = False , errorevery = 1 , ecolor = None , elinewidth = None ,
2932
2962
capsize = None , capthick = None , xlolims = False , xuplims = False ,
@@ -3022,6 +3052,9 @@ def errorbar(self, x, y, z, zerr=None, yerr=None, xerr=None, fmt='',
3022
3052
3023
3053
Other Parameters
3024
3054
----------------
3055
+ data : indexable object, optional
3056
+ DATA_PARAMETER_PLACEHOLDER
3057
+
3025
3058
**kwargs
3026
3059
All other keyword arguments for styling errorbar lines are passed
3027
3060
`~mpl_toolkits.mplot3d.art3d.Line3DCollection`.
@@ -3292,6 +3325,7 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
3292
3325
batch .append (axis_bb )
3293
3326
return mtransforms .Bbox .union (batch )
3294
3327
3328
+ @_preprocess_data ()
3295
3329
def stem (self , x , y , z , * , linefmt = 'C0-' , markerfmt = 'C0o' , basefmt = 'C3-' ,
3296
3330
bottom = 0 , label = None , orientation = 'z' ):
3297
3331
"""
@@ -3343,6 +3377,9 @@ def stem(self, x, y, z, *, linefmt='C0-', markerfmt='C0o', basefmt='C3-',
3343
3377
orientation : {'x', 'y', 'z'}, default: 'z'
3344
3378
The direction along which stems are drawn.
3345
3379
3380
+ data : indexable object, optional
3381
+ DATA_PARAMETER_PLACEHOLDER
3382
+
3346
3383
Returns
3347
3384
-------
3348
3385
`.StemContainer`
0 commit comments