mpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim#

Axes3D.set_zlim(bottom=None,top=None,*,emit=True,auto=False,view_margin=None,zmin=None,zmax=None)[source]#

Set the 3D z-axis view limits.

Parameters:
bottomfloat, optional

The bottom zlim in data coordinates. PassingNone leaves thelimit unchanged.

The bottom and top zlims may also be passed as the tuple(bottom,top) as the first positional argument (or asthebottom keyword argument).

topfloat, optional

The top zlim in data coordinates. PassingNone leaves thelimit unchanged.

emitbool, default: True

Whether to notify observers of limit change.

autobool or None, default: False

Whether to turn on autoscaling of the z-axis.True turns on,False turns off,None leaves unchanged.

view_marginfloat, optional

The additional margin to apply to the limits.

zmin, zmaxfloat, optional

They are equivalent to bottom and top respectively, and it is anerror to pass bothzmin andbottom orzmax andtop.

Returns:
bottom, top(float, float)

The new z-axis limits in data coordinates.

Notes

Thebottom value may be greater than thetop value, in whichcase the z-axis values will decrease frombottom totop.

Examples

>>>set_zlim(bottom,top)>>>set_zlim((bottom,top))>>>bottom,top=set_zlim(bottom,top)

One limit may be left unchanged.

>>>set_zlim(top=top_lim)

Limits may be passed in reverse order to flip the direction ofthe z-axis. For example, supposez represents depth of theocean in m. The z-axis limits might be set like the followingso 5000 m depth is at the bottom of the plot and the surface,0 m, is at the top.

>>>set_zlim(5000,0)

Examples usingmpl_toolkits.mplot3d.axes3d.Axes3D.set_zlim#

Plot 2D data on 3D plot

Plot 2D data on 3D plot

2D and 3D Axes in same figure

2D and 3D Axes in same figure

Automatic text offsetting

Automatic text offsetting

Draw flat objects in 3D plot

Draw flat objects in 3D plot

3D plots as subplots

3D plots as subplots

3D surface (colormap)

3D surface (colormap)

3D surface (checkerboard)

3D surface (checkerboard)

3D surface with polar coordinates

3D surface with polar coordinates

Text annotations in 3D

Text annotations in 3D

More triangular 3D surfaces

More triangular 3D surfaces