Scale bar for 2D axes

Version 1.1.0.0 (9,86 KB) von Amanda
Creates a scale bar in a 2D axes. The length, location and colour of the scale bar are customisable.
2,6K Downloads
Aktualisiert 24. Mär 2014

Lizenz anzeigen

SCALEBAR creates a scalebar on an axes

SCALEBAR
SCALEBAR OFF
SCALEBAR(PARAMETER, VALUE, ...)
SCALEBAR(HAXES, PARAMETER, VALUE, ...)
H = SCALEBAR(...)

Draws a scalebar on the axes and returns handle to the scalebar. The DataAspectRatio property of the axes must be set to [1 1 1] and the view must be in 2D. All parameters are optional (note the default values below). SCALEBAR OFF deletes the current scalebar.

PARAMETER/VALUE pairs
hAxes: handle to the axes (defaults to current axes)
ScaleLength: length to show (in data units) (defaults to ~10% of the x-axis limit range)
ScaleLengthRatio: ScaleLength/range(XLim)
Location: location of the scalebar. Possible values are
northeast (default)
northwest
southeast
southwest
[x y] data coordinates
Colour: colour of scalebar in 1x3 RGB array (default is [0 0 0])
Bold: draw with bold text and linewidth=2. True or false(default)
Unit: string containing units e.g. 'mm'

Zitieren als

Amanda (2026). Scale bar for 2D axes (https://de.mathworks.com/matlabcentral/fileexchange/25799-scale-bar-for-2d-axes), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2008b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Labels and Annotations finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.1.0.0

Fixed bug where bold font and linewidth were not updating on zoom/pan.
Added unit string option.

1.0.0.0