Visualize

Module for plotting atoms, images, line scans, and diffraction patterns.

abtem.visualize.mpl.show_atoms(atoms, repeat=1, 1, scans=None, plane='xy', ax=None, scale_atoms=0.5, title=None, numbering=False, figsize=None, legend=False)[source]

Show atoms function

Function to display atoms, especially in Jupyter notebooks.

Parameters
  • atoms (ASE atoms object) – The atoms to be shown.

  • repeat (two ints, optional) – Tiling of the image. Default is (1,1), ie. no tiling.

  • scans (ndarray, optional) – List of scans to apply. Default is None.

  • plane (str, two float) – The projection plane given as a combination of ‘x’ ‘y’ and ‘z’, e.g. ‘xy’, or the as two floats representing the azimuth and elevation angles in degrees of the viewing direction, e.g. (45, 45).

  • ax (axes object) – pyplot axes object.

  • scale_atoms (float) – Scaling factor for the atom display sizes. Default is 0.5.

  • title (str) – Title of the displayed image. Default is None.

  • numbering (bool) – Option to set plot numbering. Default is False.

abtem.visualize.mpl.show_measurement_1d(measurement, ax=None, figsize=None, legend=False, title=None, label=None, x_label=None, y_label=None, x=None, **kwargs)[source]

Show line function

Function to display a line scan.

Parameters
  • array (ndarray) – Array of measurement values along a line.

  • calibration (calibration object) – Spatial calibration for the line.

  • ax (axes object, optional) – pyplot axes object.

  • title (str, optional) – Title for the plot. Default is None.

  • legend (bool, optional) – Option to display a plot legend. Default is False.

  • kwargs – Remaining keyword arguments are passed to pyplot.

abtem.visualize.mpl.show_measurement_2d(measurement, ax=None, figsize=None, cbar=False, cbar_label=None, cmap='gray', discrete_cmap=False, vmin=None, vmax=None, power=1.0, log_scale=False, title=None, equal_ticks=False, is_rgb=False, x_label=None, y_label=None, **kwargs)[source]

Show image function

Function to display an image.

Parameters
  • array (ndarray) – Image array.

  • calibrations (tuple of calibration objects.) – Spatial calibrations.

  • ax (axes object) – pyplot axes object.

  • title (str, optional) – Image title. Default is None.

  • colorbar (bool, optional) – Option to show a colorbar. Default is False.

  • cmap (str, optional) – Colormap name. Default is ‘gray’.

  • figsize (float, pair of float, optional) – Size of the figure in inches, either as a square for one number or a rectangle for two. Default is None.

  • scans (ndarray, optional) – Array of scans. Default is None.

  • discrete (bool, optional) – Option to discretize intensity values to integers. Default is False.

  • cbar_label (str, optional) – Text label for the color bar. Default is None.

  • vmin (float, optional) – Minimum of the intensity scale. Default is None.

  • vmax (float, optional) – Maximum of the intensity scale. Default is None.

  • kwargs – Remaining keyword arguments are passed to pyplot.