将MATLAB图形保存为不同的背景颜色

14

我想打印一个MATLAB图形,它具有深色背景和白色标签。如果我使用printsaveas命令,图像的颜色会丢失。绘图符号再次变暗,而背景则变成了白色。

points = rand(100,3);
plot3(points(:,1),points(:,2),points(:,3),'*w')
grid on
set(gca,'Color',[0.5 0.5 0.5])
saveas(gcf,'test1','pdf')
saveas(gcf,'test2','png')
print(gcf,'test3.pdf','-dpdf')

这三个测试文件最终都是错误的。如果我在图形菜单中选择“另存为”,我就能正确地保存该图形。

有什么解决方法吗?

1个回答

19

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接