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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plotID
plotID_matlab
Merge requests
!57
Add PinToAxis option
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add PinToAxis option
83-positionierung-der-id-an-legende
into
development
Overview
0
Commits
1
Pipelines
1
Changes
3
Merged
Lemmer, Jan
requested to merge
83-positionierung-der-id-an-legende
into
development
3 years ago
Overview
0
Commits
1
Pipelines
1
Changes
3
Expand
Closes
#83 (closed)
0
0
Merge request reports
Compare
development
development (base)
and
latest version
latest version
04362bfe
1 commit,
3 years ago
3 files
+
36
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
+PlotID/TagPlot.m
+
27
−
5
Options
@@ -24,6 +24,7 @@ arguments
options
.
Position
(
1
,
2
)
{
mustBeVector
}
=
[
1
,
0.4
]
% default for east
options
.
Rotation
(
1
,
1
)
{
mustBeReal
}
=
NaN
options
.
ConfigFileName
(
1
,:)
{
mustBeText
}
=
'config.json'
options
.
PinToLegend
(
1
,
1
)
{
mustBeNumericOrLogical
}
=
false
% Pins ID on Legend
options
.
QRcode
(
1
,
1
)
{
mustBeNumericOrLogical
}
=
false
%experimental
options
.
QRsize
(
1
,
1
)
{
mustBeNonnegative
}
=
0.15
% size of the QRCode
end
@@ -36,7 +37,7 @@ end
switch
options
.
Location
case
'north'
y
=
1
-
options
.
DistanceToAxis
y
=
1
-
options
.
DistanceToAxis
;
options
.
Position
=
[
0.4
,
y
];
Rotation
=
0
;
case
'east'
@@ -76,16 +77,35 @@ for n = 1:numel(figs)
IDs
{
n
}
=
PlotID
.
CreateID
;
% Create ID
IDs
{
n
}
=
[
options
.
ProjectID
,
'-'
,
IDs
{
n
}];
% add options.ProjectID
pltAxes
=
get
(
figs
(
n
),
'CurrentAxes'
);
% Axes object for text annotation
% Limits for relative
P
ositioning
% Limits for relative
p
ositioning
ylim
=
get
(
pltAxes
,
'YLim'
);
xlim
=
get
(
pltAxes
,
'XLim'
);
%ID
position
=
[
options
.
Position
(
1
),
options
.
Position
(
2
)];
xlim
=
get
(
pltAxes
,
'XLim'
);
if
options
.
PinToLegend
if
options
.
QRcode
warning
([
'PinToLegend and QRCode can not be used at the same time'
,
...
newline
,
'QRcode is deactivated.'
]);
options
.
QRcode
=
false
;
end
lobj
=
findobj
(
figs
(
n
),
'Type'
,
'Legend'
);
if
isempty
(
lobj
)
set
(
0
,
'CurrentFigure'
,
figs
(
n
))
lobj
=
legend
();
end
% new position based on legend
posVec
=
get
(
lobj
,
'Position'
);
options
.
Position
(
1
)
=
posVec
(
1
)
+.
04
;
options
.
Position
(
2
)
=
posVec
(
2
);
end
% add text label
position
=
[
options
.
Position
(
1
),
options
.
Position
(
2
)];
t
=
text
(
pltAxes
,
position
(
1
),
position
(
2
),
IDs
{
n
},
'Fontsize'
,
options
.
Fontsize
,
...
'Rotation'
,
Rotation
,
'VerticalAlignment'
,
'bottom'
,
'Color'
,
...
options
.
Color
,
'BackgroundColor'
,
'w'
,
'Units'
,
'normalized'
);
set
(
figs
(
n
),
'Tag'
,
IDs
{
n
});
if
options
.
QRcode
% this should be seen and use as a proof of concept
qrCode
=
PlotID
.
plotQR
(
IDs
{
n
});
@@ -94,6 +114,8 @@ for n = 1:numel(figs)
imshow
(
qrCode
);
t
.
Visible
=
'off'
;
end
end
if
numel
(
figs
)
==
1
Loading