onstove.scale_bar#

onstove.scale_bar(style='single', size=100000, extent=0.02, loc='lower left', location=(1, 0), ax=None, borderpad=0.5, sep=4, frameon=False, linekw=None, textprops=None)[source]#

Function to create a ScaleBar object and add it to a specified or current axes.

This function takes as inputs the basic parameters needed to create a ScaleBar and adds the object as a matplotlib.artist.Artist to a specified axes or to the current axes in use if not specified.

Parameters:
style: str, default ‘single’

Graphic style of the scale, available options ‘single’ or ‘double’.

size: int, default 1

Length of bar in data units, this will match the units of the axes.

extent: float, default 0.03

Height of bar ends in axes fraction.

loc: str or int, default ‘upper left’

A location code, same as matplotlib’s legend, either: upper right, upper left, lower left, lower right, right, center left, center right, lower center, upper center or center.

ax: matplotlib.axes.Axes, optional

Object of type matplotlib.axes.Axes.

borderpad: float, default 0.5

Padding between the offsetbox frame and the bbox_to_anchor.

sep: float, default 2

Separation between the scale bar and the units.

frameon: bool, default False

Whether to draw a frame around the scale bar.

linekw: dict, optional

Style properties for the scale bar.

textprops: dict, optional

Font properties for the text.

See also

ScaleBar