plot#
- Simulation2D.plot(size_factor=1, direct_beam_position=None, in_plane_angle=0, mirrored=False, units='real', show_labels=False, label_offset=(0, 0), label_formatting=None, min_label_intensity=0.1, include_direct_beam=True, calibration=0.1, ax=None, interactive=False, **kwargs)[source]#
A quick-plot function for a simulation of spots
- Parameters:
- size_factor
float,optional linear spot size scaling, default to 1
- direct_beam_position: 2-tuple of ints, optional
The (x,y) coordinate in pixels of the direct beam. Defaults to the center of the image.
- in_plane_angle: float, optional
In plane rotation of the pattern in degrees
- mirrored: bool, optional
Whether the pattern should be flipped over the x-axis, corresponding to the inverted orientation
- units
str,optional ‘real’ or ‘pixel’, only changes scalebars, falls back on ‘real’, the default
- show_labelsbool,
optional draw the miller indices near the spots
- label_offset2-tuple,
optional the relative location of the spot labels. Does nothing if show_labels is False.
- label_formatting
dict,optional keyword arguments passed to ax.text for drawing the labels. Does nothing if show_labels is False.
- min_label_intensity
float,optional minimum intensity for a spot to be labelled
- include_direct_beambool,
optional whether to include the direct beam in the plot
- ax
matplotlibAxes,optional axes on which to draw the pattern. If None, a new axis is created
- interactivebool,
optional Whether to add sliders for selecting the rotation and phase. This is an experimental feature and will evolve/change in the future.
- **kwargs
passed to ax.scatter() method
- size_factor
- Returns:
- ax,sp
Notes
spot size scales with the square root of the intensity.