pyvista.Plotter.set_scale#
- Plotter.set_scale(
- xscale=None,
- yscale=None,
- zscale=None,
- reset_camera=True,
- render=True,
Scale all the actors 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.
Warning
Setting the scale on the renderer is a convenience method to individually scale each of the actors in the scene. If a scale was set on an actor previously, it will be reset to the scale of this Renderer.
- Parameters:
- xscale
float
,optional
Scaling in the x direction. Default is
None
, which does not change existing scaling.- yscale
float
,optional
Scaling in the y direction. Default is
None
, which does not change existing scaling.- zscale
float
,optional
Scaling in the z direction. Default is
None
, which does not change existing scaling.- reset_camerabool, default:
True
Resets camera so all actors can be seen.
- renderbool, default:
True
If the render window is being shown, trigger a render after setting the scale.
- xscale
Examples
Set the scale in the z direction to be 2 times that of nominal. Leave the other axes unscaled.
>>> import pyvista as pv >>> pl = pv.Plotter() >>> pl.set_scale(zscale=2) >>> _ = pl.add_mesh(pv.Sphere()) # perfect sphere >>> pl.show()