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
e7e5e0af
Commit
e7e5e0af
authored
Feb 21, 2022
by
Lemmer, Jan
Browse files
Options
Downloads
Patches
Plain Diff
Add QR code option
parent
d06415e5
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!62
Introduce changes for V1.0 RC 1
,
!56
Resolve "investigate QR-Code generation as option"
Pipeline
#652691
passed
Feb 21, 2022
Stage: Run
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
+PlotID/TagPlot.m
+15
-5
15 additions, 5 deletions
+PlotID/TagPlot.m
+PlotID/plotQR.m
+22
-0
22 additions, 0 deletions
+PlotID/plotQR.m
with
37 additions
and
5 deletions
+PlotID/TagPlot.m
+
15
−
5
View file @
e7e5e0af
...
@@ -24,6 +24,8 @@ arguments
...
@@ -24,6 +24,8 @@ arguments
options
.
Position
(
1
,
2
)
{
mustBeVector
}
=
[
1
,
0.4
]
% default for east
options
.
Position
(
1
,
2
)
{
mustBeVector
}
=
[
1
,
0.4
]
% default for east
options
.
Rotation
(
1
,
1
)
{
mustBeReal
}
=
NaN
options
.
Rotation
(
1
,
1
)
{
mustBeReal
}
=
NaN
options
.
ConfigFileName
(
1
,:)
{
mustBeText
}
=
'config.json'
options
.
ConfigFileName
(
1
,:)
{
mustBeText
}
=
'config.json'
options
.
QRcode
(
1
,
1
)
{
mustBeNumericOrLogical
}
=
false
%experimentally
options
.
QRsize
(
1
,
1
)
{
mustBeNonnegative
}
=
0.15
end
end
if
isempty
(
options
.
ProjectID
)
if
isempty
(
options
.
ProjectID
)
...
@@ -73,16 +75,24 @@ IDs = cell(numel(figs),1);
...
@@ -73,16 +75,24 @@ IDs = cell(numel(figs),1);
for
n
=
1
:
numel
(
figs
)
for
n
=
1
:
numel
(
figs
)
IDs
{
n
}
=
PlotID
.
CreateID
;
% Create ID
IDs
{
n
}
=
PlotID
.
CreateID
;
% Create ID
IDs
{
n
}
=
[
options
.
ProjectID
,
'-'
,
IDs
{
n
}];
% add options.ProjectID
IDs
{
n
}
=
[
options
.
ProjectID
,
'-'
,
IDs
{
n
}];
% add options.ProjectID
a
xes
=
get
(
figs
(
n
),
'CurrentAxes'
);
% Axes object for text annotation
pltA
xes
=
get
(
figs
(
n
),
'CurrentAxes'
);
% Axes object for text annotation
% Limits for relative Positioning
% Limits for relative Positioning
ylim
=
get
(
a
xes
,
'YLim'
);
ylim
=
get
(
pltA
xes
,
'YLim'
);
xlim
=
get
(
a
xes
,
'XLim'
);
xlim
=
get
(
pltA
xes
,
'XLim'
);
%ID
%ID
position
=
[
options
.
Position
(
1
),
options
.
Position
(
2
)];
position
=
[
options
.
Position
(
1
),
options
.
Position
(
2
)];
text
(
a
xes
,
position
(
1
),
position
(
2
),
IDs
{
n
},
'Fontsize'
,
options
.
Fontsize
,
...
t
=
text
(
pltA
xes
,
position
(
1
),
position
(
2
),
IDs
{
n
},
'Fontsize'
,
options
.
Fontsize
,
...
'Rotation'
,
Rotation
,
'VerticalAlignment'
,
'bottom'
,
'Color'
,
...
'Rotation'
,
Rotation
,
'VerticalAlignment'
,
'bottom'
,
'Color'
,
...
options
.
Color
,
'BackgroundColor'
,
'w'
,
'Units'
,
'normalized'
);
options
.
Color
,
'BackgroundColor'
,
'w'
,
'Units'
,
'normalized'
);
set
(
figs
(
n
),
'Tag'
,
IDs
{
n
});
set
(
figs
(
n
),
'Tag'
,
IDs
{
n
});
if
options
.
QRcode
qrCode
=
PlotID
.
plotQR
(
IDs
{
n
});
size
=
options
.
QRsize
;
axes
(
'Position'
,[
position
(
1
)
-.
05
position
(
2
)
+
0.1
size
size
]);
imshow
(
qrCode
);
t
.
Visible
=
'off'
;
end
end
end
if
numel
(
figs
)
==
1
if
numel
(
figs
)
==
1
...
...
This diff is collapsed.
Click to expand it.
+PlotID/plotQR.m
0 → 100644
+
22
−
0
View file @
e7e5e0af
function
img
=
plotQR
(
data
,
size
)
%QR reads a QR code from qrserver
% created by J.Stifter
arguments
data
{
mustBeTextScalar
}
=
'example'
;
size
(
1
,
2
)
{
mustBeInteger
}
=
[
150
,
150
];
end
m
=
size
(
1
);
n
=
size
(
2
);
base_api
=
'https://api.qrserver.com/v1/create-qr-code/?size=%dx%d&data=%s'
;
request
=
sprintf
(
base_api
,
m
,
n
,
data
);
options
=
weboptions
;
options
.
Timeout
=
5
;
img
=
webread
(
request
,
options
);
img
=
logical
(
img
);
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