Force Legend in Matlab Figure to be only one line per value

可紊 提交于 2019-12-24 05:05:57

问题


I'm wondering how I can force the text in the legend be only on one line? Like in my case there are three words and I have two values in the legend so the legend height becomes four lines. And I want to make it only two lines (one each). If anyone could please advise.


回答1:


In Matlab 2010b and in 2015a, a legend as long as

plot(1:8)
hold all
plot(2:9)
legend('one two three four five six seven eight nine ten', ...
       'one two three four five six seven eight nine ten')

gives one line per legend entry (two lines in total). See attached figures.



来源:https://stackoverflow.com/questions/29776543/force-legend-in-matlab-figure-to-be-only-one-line-per-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!