mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface#
- Axes3D.plot_surface(X,Y,Z,*,norm=None,vmin=None,vmax=None,lightsource=None,axlim_clip=False,**kwargs)[source]#
Create a surface plot.
By default, it will be colored in shades of a solid color, but it alsosupports colormapping by supplying thecmap argument.
Note
Thercount andccount kwargs, which both default to 50,determine the maximum number of samples used in each direction. Ifthe input data is larger, it will be downsampled (by slicing) tothese numbers of points.
Note
To maximize rendering speed consider settingrstride andcstrideto divisors of the number of rows minus 1 and columns minus 1respectively. For example, given 51 rows rstride can be any of thedivisors of 50.
Similarly, a setting ofrstride andcstride equal to 1 (orrcount andccount equal the number of rows and columns) can usethe optimized path.
- Parameters:
- X, Y, Z2D arrays
Data values.
- rcount, ccountint
Maximum number of samples used in each direction. If the inputdata is larger, it will be downsampled (by slicing) to thesenumbers of points. Defaults to 50.
- rstride, cstrideint
Downsampling stride in each direction. These arguments aremutually exclusive withrcount andccount. If only one ofrstride orcstride is set, the other defaults to 10.
'classic' mode uses a default of
rstride=cstride=10
insteadof the new default ofrcount=ccount=50
.- colorcolor
Color of the surface patches.
- cmapColormap, optional
Colormap of the surface patches.
- facecolorslist ofcolor
Colors of each individual patch.
- norm
Normalize
, optional Normalization for the colormap.
- vmin, vmaxfloat, optional
Bounds for the normalization.
- shadebool, default: True
Whether to shade the facecolors. Shading is always disabled whencmap is specified.
- lightsource
LightSource
, optional The lightsource to use whenshade is True.
- axlim_clipbool, default: False
Whether to hide patches with a vertex outside the axes view limits.
Added in version 3.10.
- **kwargs
Other keyword arguments are forwarded to
Poly3DCollection
.