sitator.visualization package

Submodules

sitator.visualization.atoms module

sitator.visualization.atoms.plot_atoms(atoms, positions=None, hide_species=(), wrap=False, fig=None, ax=None, i=None)
sitator.visualization.atoms.plot_points(points, marker='x', fig=None, ax=None, i=None, **kwargs)

sitator.visualization.common module

sitator.visualization.common.color_for_species(species)
sitator.visualization.common.grid(*args, **kwargs)
sitator.visualization.common.layers(*args, **fax)
sitator.visualization.common.plotter(is3D=True, **outer)
sitator.visualization.common.set_axes_equal(ax)

Make axes of 3D plot have equal scale so that spheres appear as spheres, cubes as cubes, etc.. This is one possible solution to Matplotlib’s ax.set_aspect(‘equal’) and ax.axis(‘equal’) not working for 3D.

Input
ax: a matplotlib axis, e.g., as output from plt.gca().

Module contents

class sitator.visualization.SiteNetworkPlotter(site_mappings={'marker': 'site_types'}, edge_mappings={}, markers=['x', '+', 'v', '<', '^', '>', '*', 'd', 'h', 'p'], plot_points_params={}, minmax_linewidth=(1.5, 7), minmax_edge_alpha=(0.15, 0.75), minmax_markersize=(20.0, 80.0), min_color_threshold=0.0, min_width_threshold=0.0, title='')

Bases: object

Plot a SiteNetwork.

Note that for edges, the average of the edge property for i -> j and j -> i is often used for visual clarity; if your edge properties are not almost symmetric, the visualization might not be useful.

Parameters:
  • site_mappings (dict) – defines how to show different properties. Each entry maps a visual aspect (‘marker’, ‘color’, ‘size’) to the name of a site attribute including ‘site_type’. The markers can also be arbitrary text (key “text”) in which case the value can also be a 2-tuple of an attribute name and a % format string.
  • edge_mappings (dict) – each key maps a visual property (‘intensity’, ‘color’, ‘width’, ‘linestyle’) to an edge attribute in the SiteNetwork.
  • markers (list of str) – What matplotlib markers to use for sites.
  • plot_points_params (dict) – User options for plotting site points.
  • minmax_linewidth (2-tuple) – Minimum and maximum linewidth to use.
  • minmax_edge_alpha (2-tuple) – Similar, for edge line alphas.
  • minmax_markersize (2-tuple) – Similar, for markersize.
  • min_color_threshold (float) – Minimum (normalized) color intensity for the corresponding line to be shown. Defaults to zero, i.e., all nonzero edges will be drawn.
  • min_width_threshold (float) – Minimum normalized edge width for the corresponding edge to be shown. Defaults to zero, i.e., all nonzero edges will be drawn.
  • title (str) – Title for the figure.
DEFAULT_LINESTYLES = ['--', ':', '-.', '-']
DEFAULT_MARKERS = ['x', '+', 'v', '<', '^', '>', '*', 'd', 'h', 'p']
DEFAULT_SITE_MAPPINGS = {'marker': 'site_types'}
EDGE_GROUP_COLORS = ['b', 'g', 'm', 'crimson', 'lightseagreen', 'darkorange', 'sandybrown', 'gold', 'hotpink', 'gray']
class sitator.visualization.SiteTrajectoryPlotter

Bases: object

Produce various plots of a SiteTrajectory.

plot_frame(st, frame, **kwargs)

Plot sites and instantaneous positions from a given frame.

Parameters:
plot_particle_trajectory(st, particle, ax=None, fig=None, **kwargs)

Plot the sites occupied by a mobile particle over time.

Parameters:
plot_site(st, site, **kwargs)

Plot all real space positions associated with a site.

Parameters: