plot#

KikuchiPatternSimulator.plot(projection: str | None = 'stereographic', mode: str | None = 'lines', hemisphere: str | None = 'upper', scaling: str | None = 'linear', figure: None | Figure | pyvista.Plotter = None, return_figure: bool = False, backend: str = 'matplotlib', show_plotter: bool = True, color: str = 'k', **kwargs) 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. The intensity range is [0, highest intensity].

figure

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.

color

Color to give reflectors. Either a string signifying a valid Matplotlib color or "phase", which then uses the color_rgb of the phase. Default is black ("k"). Only used with Matplotlib.

**kwargs

Keyword arguments passed to draw_circle().

Returns:
figure

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