Count the number of times I have plotted to a Figure
Show older comments
I use
h = findobj('type','figure');
n_Fig = length(h)
to determine the number of open figures,
however, I want to know if I already have plotted to a specfic figure.Number
Plot_use_count = 0;
when I plot to figure.Number (what goes here???)
Plot_use_count = Plot_use_count +1
end
I use figure(Fig_Num) as way for the GUI user to define which figure to plot to.
then I use text
XLim = xlim; YLim = ylim;
X_range = XLim(2) - XLim(1);
Y_range = YLim(2) - YLim(1);
X_text = XLim(1) + 0.02.*X_range;
Y_text = YLim(1) + (0.1.*Y_range + 0.1.*Y_range.*Plot_use_count);
text(X_text,Y_text,Str_Variable)
to place text on the plot. This works fine for the 1st time Fig_Num is used, but if re-used (i.e. has the same value), the the text is overwritten, rather than
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!