set_scale

Plotter.set_scale(xscale=None, yscale=None, zscale=None, reset_camera=True)

Scale all the datasets in the scene.

Scaling in performed independently on the X, Y and Z axis. A scale of zero is illegal and will be replaced with one.

Parameters
xscalefloat, optional

Scaling in the x direction. Default is None, which does not change existing scaling.

yscalefloat, optional

Scaling in the y direction. Default is None, which does not change existing scaling.

zscalefloat, optional

Scaling in the z direction. Default is None, which does not change existing scaling.

reset_camerabool, optional

Resets camera so all actors can be seen. Default True.

Examples

Set the scale in the z direction to be 5 times that of nominal. Leave the other axes unscaled.

>>> import pyvista
>>> pl = pyvista.Plotter()
>>> pl.set_scale(zscale=5)
>>> _ = pl.add_mesh(pyvista.Sphere())  # perfect sphere
>>> pl.show()
../../../_images/pyvista-Plotter-set_scale-1_00_00.png