, 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.


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.


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.


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.