0001 function [figs, ID] = TagPlot(figs, prefix)
0002
0003
0004
0005 arguments
0006 figs (1,:) {mustBeFigure}
0007 prefix (1,:) {mustBeText}= ''
0008 end
0009
0010 if isempty(prefix)
0011 warning('no project prefix defined')
0012 end
0013
0014 for n = 1:numel(figs)
0015 ID = CreateID;
0016 ID = [prefix,'-',ID];
0017 axes = get(figs(n),'CurrentAxes');
0018
0019 ylim =get(axes,'YLim');
0020 xlim =get(axes,'XLim');
0021
0022 text(axes,xlim(2),0.4*ylim(2), ID,'Fontsize',8,'Rotation',90,'VerticalAlignment','bottom',...
0023 'Color', 0.65*[1 1 1],'BackgroundColor','w');
0024 set(figs(n),'Tag', ID);
0025
0026 end
0027
0028 end
0029
0030 function tf = mustBeFigure(h)
0031 tf = strcmp(get(h, 'type'), 'figure') & isa(h, 'matlab.ui.Figure');
0032 end