Matlab图中的图例强制每个值仅占一行 [英] Force Legend in Matlab Figure to be only one line per value

查看:172
本文介绍了Matlab图中的图例强制每个值仅占一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何强制图例中的文本仅在一行上?就像我的情况一样,图例中有三个单词,而我有两个值,因此图例高度变为四行.我只想使其两行(每行一行).如果有人可以请指教.

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.

推荐答案

在Matlab 2010b和2015a中,一个传说只要

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.

这篇关于Matlab图中的图例强制每个值仅占一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆