# Examples from pyvista.Plotter.update_scalar_bar_range
# =====================================================

# Update the range of a named scalar bar.
import pyvista as pv
mesh = pv.Sphere()
mesh['height'] = mesh.points[:, 2]
pl = pv.Plotter()
_ = pl.add_mesh(
    mesh,
    scalars='height',
    clim=(-0.5, 0.5),
    scalar_bar_args={'title': 'Height'},
)
pl.update_scalar_bar_range((-1, 1), name='Height')
pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
