legend at a desired location on a plot

3 次查看(过去 30 天)
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.

更多回答(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