ChimeraX docs icon

Command: scalebar

Usage:
scalebarlength ] [ thickness  pixel-height ] [ xpos  x-position ] [ ypos  y-position ] [ color  color-spec | default ]

Usage:
scalebar ( delete | off )

The scalebar command draws a horizontal bar of the specified length (initial default 100 Å). It is the command-line implementation of the Scale Bar tool. A text label is not included, but can be added with the 2dlabels command. See also: key, zoom, making images

Only one scale bar can be present at a time. Initial defaults are described below, but using the command when a scale bar is already present simply updates the existing model; any unspecified options are left unchanged.

The scale bar is a 2D object (no depth, cannot be moved forward/backward) and is simply drawn on top of the view, like 2D labels. It can be repositioned by dragging with the move label mouse mode and is created as a 2D labels submodel that can be controlled with the Model Panel and general commands such as close and show/hide.

The command scalebar delete or scalebar off removes an existing scale bar model.

Options

length
Length of the scale bar in physical units of distance (initial default 100 Å) based on the pixel-to-length correspondence at the center of rotation. The length in pixels will automatically adjust for changes in zoom. In perspective projection, objects appear progressively larger in the front and smaller in the back; for a constant relationship of pixels to length at all depths, use orthographic projection instead (command camera ortho).
thickness  pixel-height
Height in pixels of the scale bar (initial default 10).
xpos  x-position
ypos  y-position
Lower-left-corner position of the rectangular scale bar along the X (horizontal) and Y (vertical) axes, with 0.1 as the initial default for each. The values are expressed in fractional coordinates 0.0-1.0 where 1.0 represents the full width or height of the graphics window and 1.0,1.0 its top right corner.
color  color-spec | default
Color of the scale bar. If set to auto or default (initial default), it will automatically adjust to white or black depending on the color of the window background.

UCSF Resource for Biocomputing, Visualization, and Informatics / July 2021