Scalebar
Create a scalebar object for x- and or y-axis. Scalebar appearance is configured on creation, through setting of properties, or interactively using a context menu.
Features
- Option to autoadjust scalebar on zoom.
- Scalebar stays in place on zooming and panning
- Update scalebar size and appearance interactively from contextmenu
- Save scalebar appearance to preferences, so next scalebar created will use same appearance.
Example
f = figure();
hAx = axes(f);
imshow('cell.tif', 'Parent', hAx);
pixPerUm = 5;
scalebarLength = 10; % scalebar will be 10 micrometer long
unit = sprintf('%sm', '\mu'); % micrometer
hScalebar = scalebar(hAx, 'x', scalebarLength, unit, 'Location', 'southeast', ...
'ConversionFactor', pixPerUm);
Known Bugs
Scalebar position is not correctly updated when interactive zooming tools are activated and user doubleclicks in axes
引用格式
Eivind Hennestad (2024). Scalebar for images and plots (https://www.mathworks.com/matlabcentral/fileexchange/109114-scalebar-for-images-and-plots), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2020b
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!