3

使用 saveas 保存图形时,我遇到了一些奇怪的行为。你应该能够用这个重现这个:

%just plot a line:
plot(1:10);
legend('line 1')
%find the line (not the best solution, but its working here):
temp=findall(legend,'type','line')
%modify the marker of the line within the legend:
set(temp(1),'Marker','o')
%save it:
saveas(gcf,'Test','fig')

如果您现在打开该图,图例中的修改似乎消失了。

问题是:

如何以显示方式保存它,包括图例的更改?

也许,如果有人知道:

saveas 这种行为的原因是什么?

附加信息:Matlab 2013a

4

1 回答 1

1

问题是您正在更改图例而不是行上的标记。当 Matlab 加载保存的图形时,它会自动设置图例以匹配线/标记。我怀疑你是否可以改变这种行为。

于 2013-10-02T14:39:18.073 回答