abtem.visualize.artists

Contents

abtem.visualize.artists#

Module Contents#

Classes#

Functions#

API#

class abtem.visualize.artists.AreaIndicator(...)[source]#

Initialization

class abtem.visualize.artists.Artist(...)[source]#

Initialization

abstract get_power()[source]#
abstract get_xlim()[source]#
abstract get_ylim()[source]#
abstract remove()[source]#
abstract set_data(...)[source]#
set_logscale()[source]#
abstract set_power(...)[source]#
abstract set_value_limits(...)[source]#
set_xlabel(...)[source]#
set_xlim(...)[source]#
set_ylabel(...)[source]#
set_ylim(...)[source]#
class abtem.visualize.artists.Artist1D(...)[source]#

Bases: abtem.visualize.artists.Artist

Initialization

class abtem.visualize.artists.Artist2D(...)[source]#

Bases: abtem.visualize.artists.Artist

Initialization

abstract add_area_indicator(...)[source]#
abstract get_value_limits()[source]#
abstract get_xlim()[source]#
abstract get_ylim()[source]#
abstract property num_cbars#
abstract set_cbars(...)[source]#
abstract set_cmap(...)[source]#
abstract set_data(...)[source]#
set_logscale()[source]#
abstract set_power(...)[source]#
set_scale_bars(...)[source]#
abstract set_value_limits(...)[source]#
class abtem.visualize.artists.CircleAnnotations(...)[source]#

Initialization

set_placement(...)[source]#
set_threshold(...)[source]#
set_visible(...)[source]#
property threshold#
class abtem.visualize.artists.DomainColoringArtist(...)[source]#

Bases: abtem.visualize.artists.Artist2D

Initialization

property amplitude_axes_image#
property amplitude_norm#
get_power()[source]#
get_value_limits()[source]#
get_xlim()[source]#
get_ylim()[source]#
num_cbars#

2

property phase_axes_image#
remove()[source]#
set_cbars(...)[source]#
set_cmap(...)[source]#
set_data(...)[source]#
set_extent(...)[source]#
set_power(...)[source]#
set_value_limits(...)[source]#
class abtem.visualize.artists.ImageArtist(...)[source]#

Bases: abtem.visualize.artists.Artist2D

Initialization

property axes_image#
get_power()[source]#
get_value_limits()[source]#
get_xlim()[source]#
get_ylim()[source]#
property norm#
num_cbars#

1

remove()[source]#
set_cbars(...)[source]#
set_cmap(...)[source]#
set_data(...)[source]#
set_extent(...)[source]#
set_logscale(...)[source]#
set_power(...)[source]#
set_value_limits(...)[source]#
class abtem.visualize.artists.LinesArtist(...)[source]#

Bases: abtem.visualize.artists.Artist1D

Initialization

get_logscale()[source]#
get_power()[source]#
get_value_limits()[source]#
get_xlim()[source]#
get_ylim()[source]#
num_cbars#

0

remove()[source]#
set_data(...)[source]#
set_legend(...)[source]#
set_logscale()[source]#
abstract set_power(...) None[source]#
set_value_limits(...)[source]#
class abtem.visualize.artists.OverlayImshowArtist(...)[source]#

Bases: abtem.visualize.artists.Artist2D

Initialization

class abtem.visualize.artists.ScaleBar(...)[source]#

Initialization

class abtem.visualize.artists.ScaledCircleCollection(...)[source]#

Bases: matplotlib.collections.Collection

Create a collection of circles with radii scaled by the data.

Parameters:
  • array (ndarray) – Array of data values. Used to calculate the radii of the circles. The shape should be (n,).

  • offsets (ndarray) – Array of offsets for the circles. The shape should be (n, 2) where n is the number of circles.

  • scale (float, optional) – Scaling factor for the radii, by default 1.0.

  • threshold (float, optional) – Threshold for showing the circles, by default 1e-6.

  • kwargs (dict) – Additional keyword arguments passed to the matplotlib.collections.Collection constructor.

Initialization

Parameters:
  • edgecolors (color or list of colors, default: rcParams[“patch.edgecolor”] (default: 'black')) – Edge color for each patch making up the collection. The special value ‘face’ can be passed to make the edgecolor match the facecolor.

  • facecolors (color or list of colors, default: rcParams[“patch.facecolor”] (default: 'C0')) – Face color for each patch making up the collection.

  • hatchcolors (color or list of colors, default: rcParams[“hatch.color”] (default: 'edge')) – Hatch color for each patch making up the collection. The color can be set to the special value ‘edge’ to make the hatchcolor match the edgecolor.

  • linewidths (float or list of floats, default: rcParams[“patch.linewidth”] (default: 1.0)) – Line width for each patch making up the collection.

  • linestyles (str or tuple or list thereof, default: 'solid') –

    Valid strings are [‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’, ‘-‘, ‘–’, ‘-.’, ‘:’]. Dash tuples should be of the form:

    (offset, onoffseq),
    

    where onoffseq is an even length tuple of on and off ink lengths in points. For examples, see /gallery/lines_bars_and_markers/linestyles.

  • capstyle (.CapStyle-like, default: ‘butt’) – Style to use for capping lines for all paths in the collection. Allowed values are %(CapStyle)s.

  • joinstyle (.JoinStyle-like, default: ‘round’) – Style to use for joining lines for all paths in the collection. Allowed values are %(JoinStyle)s.

  • antialiaseds (bool or list of bool, default: rcParams[“patch.antialiased”] (default: True)) – Whether each patch in the collection should be drawn with antialiasing.

  • offsets ((float, float) or list thereof, default: (0, 0)) – A vector by which to translate each patch after rendering (default is no translation). The translation is performed in screen (pixel) coordinates (i.e. after the Artist’s transform is applied).

  • offset_transform (~.Transform, default: .IdentityTransform) – A single transform which will be applied to each offsets vector before it is used.

  • cmap – Data normalization and colormapping parameters. See .ScalarMappable for a detailed description.

  • norm – Data normalization and colormapping parameters. See .ScalarMappable for a detailed description.

  • hatch (str, optional) – Hatching pattern to use in filled paths, if any. Valid strings are [‘/’, ‘', ‘|’, ‘-’, ‘+’, ‘x’, ‘o’, ‘O’, ‘.’, ‘*’]. See /gallery/shapes_and_collections/hatch_style_reference for the meaning of each hatch type.

  • pickradius (float, default: 5.0) – If pickradius <= 0, then .Collection.contains will return True whenever the test point is inside of one of the polygons formed by the control points of a Path in the Collection. On the other hand, if it is greater than 0, then we instead check if the test point is contained in a stroke of width 2*pickradius following any of the Paths in the Collection.

  • urls (list of str, default: None) – A URL for each patch to link to once drawn. Currently only works for the SVG backend. See /gallery/misc/hyperlinks_sgskip for examples.

  • zorder (float, default: 1) – The drawing order, shared by all Patches in the Collection. See /gallery/misc/zorder_demo for all defaults and examples.

  • **kwargs – Remaining keyword arguments will be used to set properties as Collection.set_{key}(val) for each key-value pair in kwargs.

draw(...)[source]#
get_all_offsets()[source]#
get_radii()[source]#
get_scale()[source]#
set_array(...)[source]#
set_data(...)[source]#
set_norm(...)[source]#
set_scale(...)[source]#
set_threshold(...)[source]#
property threshold#
class abtem.visualize.artists.ScatterArtist(...)[source]#

Bases: abtem.visualize.artists.Artist2D

Initialization

property annotations: list[matplotlib.text.Annotation]#
property circle_collection: ScaledCircleCollection#
get_offsets()[source]#
get_power()[source]#
get_scale()[source]#
get_value_limits()[source]#
get_xlim()[source]#
get_ylim()[source]#
num_cbars#

1

remove()[source]#
set_annotation_kwargs(...)[source]#
set_cbars(...)[source]#
set_cmap(...)[source]#
set_data(...)[source]#
set_logscale(...)[source]#
set_power(...)[source]#
set_scale(...)[source]#
set_value_limits(...)[source]#
abtem.visualize.artists.default_cbar_scalar_formatter()[source]#
abtem.visualize.artists.get_extent(...)[source]#
abtem.visualize.artists.validate_cmap(...)[source]#