plot#

DiffractionSimulation.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={'ha': 'center', 'va': 'center'}, ax=None, **kwargs)[source]#

A quick-plot function for a simulation of spots

Parameters:
size_factorfloat, 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

unitsstr, 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_formattingdict, optional

keyword arguments passed to ax.text for drawing the labels. Does nothing if show_labels is False.

axmatplotlib Axes, optional

axes on which to draw the pattern. If None, a new axis is created

**kwargs

passed to ax.scatter() method

Returns:
ax,sp

Notes

spot size scales with the square root of the intensity.