Check out the Hyperspy Workshop May 13-17, 2024 Online

get_color_image_with_indicator#

DPCSignal2D.get_color_image_with_indicator(phase_rotation=0, indicator_rotation=0, only_phase=False, autolim=True, autolim_sigma=4, magnitude_limits=None, scalebar_size=None, ax=None, ax_indicator=None)[source]#

Make a matplotlib figure showing DPC contrast.

Parameters:
  • phase_rotation (float, default 0) – Changes the phase of the plotted data. Useful for correcting scan rotation.

  • indicator_rotation (float, default 0) – Changes the color wheel rotation.

  • only_phase (bool, default False) – If False, will plot both the magnitude and phase. If True, will only plot the phase.

  • autolim (bool, default True)

  • autolim_sigma (float, default 4)

  • magnitude_limits (tuple of floats, default None) – Manually sets the value limits for the color signal. For this, autolim needs to be False.

  • scalebar_size (int, optional)

  • ax (Matplotlib subplot, optional)

  • ax_indicator (Matplotlib subplot, optional) – If None, generate a new subplot for the indicator. If False, do not include an indicator

Examples

>>> s = pxm.data.dummy_data.get_simple_dpc_signal()
>>> fig = s.get_color_image_with_indicator()
>>> fig.savefig("simple_dpc_test_signal.png")

Only plotting the phase

>>> fig = s.get_color_image_with_indicator(only_phase=True)
>>> fig.savefig("simple_dpc_test_signal.png")

Matplotlib subplot as input

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> ax_indicator = fig.add_subplot(331)
>>> fig_return = s.get_color_image_with_indicator(
...     scalebar_size=10, ax=ax, ax_indicator=ax_indicator)