Skip to content
Snippets Groups Projects
Commit d7cc516b authored by Lemmer, Jan's avatar Lemmer, Jan
Browse files

simple tagging works

parent 523e3996
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment