plot#

KikuchiPatternSimulator.plot(projection: Optional[str] = 'stereographic', mode: Optional[str] = 'lines', hemisphere: Optional[str] = 'upper', scaling: Optional[str] = 'linear', figure=None, return_figure: bool = False, backend: str = 'matplotlib', show_plotter: bool = True) Union[Figure, pyvista.Plotter][source]#

Plot reflectors as lines or bands in the stereographic or spherical projection.

Parameters:
projection

Either "stereographic" (default) or "spherical".

mode

Either "lines" (default) or "bands". The latter option requires that reflectors have Bragg angles (theta) calculated.

hemisphere

Which hemisphere to plot when projection="stereographic". Options are "upper" (default), "lower" or "both". Ignored if figure is given.

scaling

Intensity scaling of the band kinematical intensities, either "linear" (default), \(|F|\), "square", \(|F|^2\), or "None", giving all bands the same intensity.

figurematplotlib.figure.Figure or pyvista.Plotter, optional

An existing Figure or Plotter to add the reflectors to. If not given, a new figure is created.

return_figure

Whether to return the figure. Default is False. This is a Figure if backend=="matplotlib" or a Plotter if backend=="pyvista".

backend

Which plotting library to use when projection="spherical", either "matplotlib" (default) or "pyvista". The latter option requires that PyVista is installed.

show_plotter

Whether to show the Plotter when projection="spherical" and backend="pyvista". Default is True.

Returns:
figure

If return_figure=True, a Figure or a Plotter is returned.