Scale bar for 2D axes

版本 1.1.0.0 (9.9 KB) 作者: Amanda
Creates a scale bar in a 2D axes. The length, location and colour of the scale bar are customisable.
2.5K 次下载
更新时间 2014/3/24

查看许可证

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'

引用格式

Amanda (2024). Scale bar for 2D axes (https://www.mathworks.com/matlabcentral/fileexchange/25799-scale-bar-for-2d-axes), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2008b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
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