Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
irp
HoloTomoToolbox
Commits
3fcd1b4e
Commit
3fcd1b4e
authored
Jan 12, 2022
by
p.jhagema
Browse files
addScalebar: option to adjust offset between bar and label
parent
5c823582
Pipeline
#265405
passed with stage
in 43 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
functions/plotting/addScalebar.m
View file @
3fcd1b4e
...
...
@@ -28,6 +28,9 @@ function scalebar = addScalebar(scalebarLength, pixelsize, settings)
% the label is '<scalebarLength> micron'.
% fontSize : Default = 12
% Font size of the scalebar label.
% offset: Default = 18
% Offset between scalebar and label. Default value equals 1.5 times the
% FontSize
%
% Returns
% -------
...
...
@@ -77,6 +80,7 @@ defaults.scalebarColor = 'k';
defaults
.
scalebarWidth
=
4
;
defaults
.
scalebarText
=
[];
defaults
.
fontSize
=
12
;
defaults
.
offset
=
18
;
if
(
nargin
==
0
)
scalebar
=
defaults
;
...
...
@@ -101,7 +105,8 @@ posScalebarY = figureAxes(4) * settings.posY;
line
([
posScalebarX
posScalebarX
-
scalebar
],[
posScalebarY
posScalebarY
],
'LineWidth'
,
...
settings
.
scalebarWidth
,
'Color'
,
settings
.
scalebarColor
);
text
(
posScalebarX
-
0.5
*
scalebar
,
posScalebarY
-
15.
*
settings
.
scalebarWidth
,
settings
.
scalebarText
,
...
text
(
posScalebarX
-
0.5
*
scalebar
,
posScalebarY
-
settings
.
offset
-
settings
.
fontSize
,
settings
.
scalebarText
,
...
'Color'
,
settings
.
scalebarColor
,
'FontSize'
,
settings
.
fontSize
,
...
'HorizontalAlignment'
,
'center'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment