概述
I want to print a MATLAB figure with a dark background and white labels. If I use the print or saveas command I lose somehow the colors. The plot symbols are dark again and the background is white.
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')
All three test files end up being wrong. If I choose "Save As" in the figure menu I am able to save the figure correctly.
Any ideas how to resolve the issue?
解决方案
To keep the background as in your figure, use the command set.
set(gcf, 'InvertHardCopy', 'off');
For adjusting the figure in other ways, check out this link
最后
以上就是小巧蜗牛为你收集整理的matlab导出图片背景_保存具有不同背景颜色的MATLAB图形的全部内容,希望文章能够帮你解决matlab导出图片背景_保存具有不同背景颜色的MATLAB图形所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复