问题
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