Matlab suptitle隐藏传奇

时间:2014-07-10 08:20:24

标签: matlab plot legend subplot

我正在使用suptitle.m文件在3上添加一个主标题 次要情节。每个子图都有自己的图例。我发出之后 suptitle命令,最后一个情节的传说消失了。有没有人 以前见过这个吗?我该如何解决这个问题?

10年前在Matworks上提出了同样的问题,没有答案。

http://www.mathworks.com/matlabcentral/newsreader/view_thread/44980

附加

如果我绘制图形,然后操纵图例位置。然后设置suptitle,它是被操纵的最后一个传说,它隐藏在情节后面。 这似乎是某些信息隐藏在suptitle.m

使用的内存中

3 个答案:

答案 0 :(得分:1)

在写suptitle后,不要替换最后一个图,而是这样使用:

figure()
suptitle('Your Title');
subplot(3,1,1)
plot.....
subplot(3,1,2)
plot.....
subplot(3,1,3)
plot.....

这样suptitle不会干扰任何子图的图例。

答案 1 :(得分:1)

作为X射线工具箱的一部分,张江为suptitle中消失的传说提供了解决方案。基本上,您只需要在suptitle.m末尾包含以下行:

% fix legend if one exists
legH = legend;
if ~isempty(legH)
    axes(legH);
end

这将重新激活缺少的图例。

遵循江的suptitle.m的实施。在脚本中搜索“legend”,找到解决方案的代码片段。

Sauro Salomoni

答案 2 :(得分:0)

<强>解决方案 我查看了代码并且无法解决问题。但是通过在最后一个情节之前创建suptitle它可以工作

figure()
subplot(3,1,1)
plot.....
subplot(3,1,2)
plot.....
subplot(3,1,3)
suptitle('Your Title');
plot.....