Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
plotID_matlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plotID
plotID_matlab
Commits
d7cc516b
Commit
d7cc516b
authored
Jun 14, 2021
by
Lemmer, Jan
Browse files
Options
Downloads
Patches
Plain Diff
simple tagging works
parent
523e3996
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
MATLAB/TagPlot.m
+19
-5
19 additions, 5 deletions
MATLAB/TagPlot.m
with
19 additions
and
5 deletions
MATLAB/TagPlot.m
+
19
−
5
View file @
d7cc516b
function
[
outputArg1
,
outputArg2
]
=
TagPlot
(
figs
)
function
[
figs
]
=
TagPlot
(
figs
,
prefix
)
%TagPlot adds IDs to figures
%TagPlot adds IDs to figures
% The ID is placed visual on the figure window and as Tag (Property of figure)
% TagPlot can Tag multiple figures at once
% TagPlot can Tag multiple figures at once
arguments
arguments
figs
(
1
,:)
{
mustBeFigure
}
figs
(
1
,:)
{
mustBeFigure
}
prefix
(
1
,:)
{
mustBeText
}
=
''
end
end
for
n
=
1
:
numel
(
figs
)
if
isempty
(
prefix
)
ID
=
CreateID
;
warning
(
'no project prefix defined'
)
end
end
for
n
=
1
:
numel
(
figs
)
ID
=
CreateID
;
% Create ID
axes
=
get
(
figs
(
n
),
'CurrentAxes'
);
% Axes object for text annotation
% Limits for relative Positioning
ylim
=
get
(
axes
,
'YLim'
);
xlim
=
get
(
axes
,
'XLim'
);
%ID
text
(
xlim
(
2
),
0.4
*
ylim
(
2
),
ID
,
'Fontsize'
,
8
,
'Rotation'
,
90
,
'VerticalAlignment'
,
'bottom'
,
...
'Color'
,
0.65
*
[
1
1
1
],
'BackgroundColor'
,
'w'
);
set
(
figs
(
n
),
'Tag'
,
ID
);
function
tf
=
mustBeFigure
(
h
)
%check if input is a figure object
tf
=
strcmp
(
get
(
h
,
'type'
),
'figure'
)
&
isa
(
h
,
'matlab.ui.Figure'
);
end
end
end
end
function
tf
=
mustBeFigure
(
h
)
%checks if input is a figure object
tf
=
strcmp
(
get
(
h
,
'type'
),
'figure'
)
&
isa
(
h
,
'matlab.ui.Figure'
);
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment