unregister_plotter_component#
- unregister_plotter_component(name: str, target_cls: type | None = None) None[source]#
Remove a component previously attached to a plotter class.
The inverse of
register_plotter_component(). Restores any built-in attribute that was shadowed viaoverride=Truewhen the component was registered.Added in version 0.48.0.
- Parameters:
- name
str Namespace of the component to remove.
- target_cls
type,optional Target class the component was registered against. Defaults to
pyvista.BasePlotter. Only components attached directly ontarget_clscan be unregistered; a component inherited from a parent class must be unregistered on that parent.
- name
- Raises:
ValueErrorIf no component named
nameis attached directly totarget_cls.TypeErrorIf
target_clsis not a class, ornameis not a string.
Examples
>>> import pyvista as pv >>> @pv.register_plotter_component('tmp') ... class TmpComponent: ... def __init__(self, plotter): ... self._plotter = plotter >>> pv.unregister_plotter_component('tmp')