Putting Annotation on Plot Area

7 次查看(过去 30 天)
I have a plot of variables and a variable called 'name' which contains a string. I want to have a text box display the string contained in the variable named. I have the following code:
figure
plot(SR,Pcr)
title('Critical Buckling Load vs Slenderness Ratio')
xlabel('Slenderness Ratio')
ylabel('Critical Buckling Load')
annotation('textbox',sprintf(name),'FitBoxToText','on');
end

采纳的回答

Walter Roberson
Walter Roberson 2015-9-16
boxsize = [.2 .2 .8 .1]; %for example
annotation('textbox', boxsize, 'String', name, 'FitBoxToText','on');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by