biotite.structure.graphics.plot_atoms

biotite.structure.graphics.plot_atoms(axes, atoms, colors, line_width=1.0, background_color=None, center=None, size=None, zoom=1.0)[source]

Plot an AtomArray as lines between bonded atoms.

The z-axis points into the screen plane.

Parameters
axesAxes3D

The Matplotlib 3D-axes to plot the structure on.

atomsAtomArray, shape=(n,)

The structure to be plotted. The atom array must have an associated BondList, i.e. its bonds attribute must be defined. One line for each bond is drawn.

colorsndarray, shape=(n,3) or shape=(n,4), dtype=float

An array of RGB or RGBA colors for each atom in atoms. The values for each color channel are in the range 0 to 1.

line_widthfloat, optional

The width of the lines to be drawn.

background_colorobject

A Matplotlib compatible color (color name or RGB values). If set, the background is colored with the given value.

centertuple of (float, float, float), optional

The coordinates of the structure that are in the center of the plot. By default the complete molecule is centered.

sizefloat, optional

The size of each dimension in the plot. The limits of the Axes3D are set to (center - size/(2*zoom)), (center + size/(2*zoom)).

zoomfloat, optional

Zoom in or zoom out.

  • > 1.0: Zoom in.

  • < 1.0: Zoom out.

Notes

This is a very simple visualization tools for quick visual analysis of a structure. For publication-ready molecular images the usage of a dedicated molecular visualization tool is recommended.