我想打印一个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')
这三个测试文件最终都是错误的。如果我在图形菜单中选择“另存为”,我就能正确地保存该图形。
有什么解决方法吗?