【问题标题】:Save MATLAB figure with different background color用不同的背景颜色保存 MATLAB 图
【发布时间】:2011-06-20 15:33:22
【问题描述】:

我想打印一个带有深色背景和白色标签的 MATLAB 图。如果我使用print 或saveas 命令,我会以某种方式失去颜色。绘图符号再次变暗,背景为白色。

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')

所有三个测试文件最终都是错误的。如果我在图形菜单中选择“另存为”,我可以正确保存图形。

有解决问题的方法吗?

【问题讨论】:

    标签: matlab printing figure save-as


    【解决方案1】:

    要使背景与您的图中一样,请使用命令集。

    set(gcf, 'InvertHardCopy', 'off');

    其他方式调整图形,查看此链接

    http://www.mathworks.com/help/techdoc/creating_plots/f3-84337.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-08
      • 2021-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-13
      相关资源
      最近更新 更多