フィルターのクリア

How do I move the legend on my plot?

103 ビュー (過去 30 日間)
Josie
Josie 2014 年 8 月 1 日
編集済み: Adam 2014 年 8 月 1 日
I'd like to move the legend to the upper left corner of my plot. How do I do this?
M=linspace(0,0.1,500);
g=10;
for A=0.1:0.1:0.9
s=(A-0.5)*M*g-(A^2)/4;
theta=s./(2*M.*(A-0.5)^2+2*M+(A^2-A+1/3)/2);
N=((2*M-0.5*(A^2-A+1/6)).*theta-0.25*(A^2-A))/(A-0.5);
plot(M,N)
axis([0,0.1,-0.4,1])
hold all
end
legend('A=0.1','A=0.2','A=0.3','A=0.4','A=0.5','A=0.6','A=0.7','A=0.8','A=0.9')

回答 (1 件)

Adam
Adam 2014 年 8 月 1 日
編集済み: Adam 2014 年 8 月 1 日
legend(...,'Location', 'location')
allows you to either specify the 'location' as one of a huge number of pre-defined positions e.g 'NorthWest', 'NorthWestOutside' or as a standard 1-by-4 position vector for precise manual positioning.
The pre-defined locations are included in a list on the help page for 'legend'

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by