legend at a desired location on a plot

조회 수: 10 (최근 30일)
Megha
Megha 2019년 1월 7일
댓글: Star Strider 2019년 1월 7일
How to put legend on a deisred location i.e desired x,y points in matlab?
In a plot of
X = 1:10;
Y = 1:10;
plot(X,Y);
legend([5,5],'linear')
I want legend at the centre of the plot at [x,y] = [5,5]
Is there any way to ge it?
I do not want legend orienattaion and locataions like 'SouthWest','SouthWestOutside'... and so on....
  댓글 수: 1
madhan ravi
madhan ravi 2019년 1월 7일
편집: madhan ravi 2019년 1월 7일
text() perhaps? , I think legend can not be specified at a certain point expect the options that you posted

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2019년 1월 7일
Use the 'Position' (link) property of legend.
It does not work exactly as you would like it to, however you apparently can put it anywhere in the figure window.
  댓글 수: 2
Megha
Megha 2019년 1월 7일
Yes, it worked! Thanks @Star Strider
Star Strider
Star Strider 2019년 1월 7일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by