show_bounds

Renderer.show_bounds(mesh=None, bounds=None, show_xaxis=True, show_yaxis=True, show_zaxis=True, show_xlabels=True, show_ylabels=True, show_zlabels=True, bold=True, font_size=None, font_family=None, color=None, xlabel='X Axis', ylabel='Y Axis', zlabel='Z Axis', use_2d=False, grid=None, location='closest', ticks=None, all_edges=False, corner_factor=0.5, fmt=None, minor_ticks=False, padding=0.0, render=None)

Add bounds axes.

Shows the bounds of the most recent input mesh unless mesh is specified.

Parameters
meshpyvista.DataSet or pyvista.MultiBlock

Input mesh to draw bounds axes around.

boundslist or tuple, optional

Bounds to override mesh bounds in the form [xmin, xmax, ymin, ymax, zmin, zmax].

show_xaxisbool, optional

Makes x axis visible. Default True.

show_yaxisbool, optional

Makes y axis visible. Default True.

show_zaxisbool, optional

Makes z axis visible. Default True.

show_xlabelsbool, optional

Shows x labels. Default True.

show_ylabelsbool, optional

Shows y labels. Default True.

show_zlabelsbool, optional

Shows z labels. Default True.

boldbool, optional

Bolds axis labels and numbers. Default True.

font_sizefloat, optional

Sets the size of the label font. Defaults to 16.

font_familystr, optional

Font family. Must be either 'courier', 'times', or 'arial'.

colorstr or 3 item list, optional

Color of all labels and axis titles. Default white. Either a string, rgb list, or hex color string. For example:

  • color='white'

  • color='w'

  • color=[1, 1, 1]

  • color='#FFFFFF'

xlabelstr, optional

Title of the x axis. Default "X Axis".

ylabelstr, optional

Title of the y axis. Default "Y Axis".

zlabelstr, optional

Title of the z axis. Default "Z Axis".

use_2dbool, optional

This can be enabled for smoother plotting.

Warning

A bug with vtk 6.3 in Windows seems to cause this function to crash.

gridbool or str, optional

Add grid lines to the backface (True, 'back', or 'backface') or to the frontface ('front', 'frontface') of the axes actor.

locationstr, optional

Set how the axes are drawn: either static ('all'), closest triad (front), furthest triad ('back'), static closest to the origin ('origin'), or outer edges ('outer') in relation to the camera position. Options include: 'all', 'front', 'back', 'origin', 'outer'.

ticksstr, optional

Set how the ticks are drawn on the axes grid. Options include: 'inside', 'outside', 'both'.

all_edgesbool, optional

Adds an unlabeled and unticked box at the boundaries of plot. Useful for when wanting to plot outer grids while still retaining all edges of the boundary.

corner_factorfloat, optional

If all_edges``, this is the factor along each axis to draw the default box. Default is 0.5 to show the full box.

fmtstr, optional

A format string defining how tick labels are generated from tick positions. A default is looked up on the active theme.

minor_ticksbool, optional

If True, also plot minor ticks on all axes.

paddingfloat, optional

An optional percent padding along each axial direction to cushion the datasets in the scene from the axes annotations. Defaults to 0 (no padding).

renderbool, optional

If the render window is being shown, trigger a render after showing bounds.

Returns
vtk.vtkCubeAxesActor

Bounds actor.

Examples

>>> import pyvista
>>> mesh = pyvista.Sphere()
>>> plotter = pyvista.Plotter()
>>> actor = plotter.add_mesh(mesh)
>>> actor = plotter.show_bounds(grid='front', location='outer', 
...                             all_edges=True)
>>> plotter.show()
../../../_images/pyvista-Renderer-show_bounds-1_00_00.png