Cropped off markers when exporting figures as PNG

2 次查看(过去 30 天)
Hello,
I have run into an issue where seemingly randomly - though probably only at the periphery of graphs, circular markers are cropped off leaving arcs when exporting to PNG. I've attached one example of code and produced figure below - I have not tested if any of the messing with the defaults is critical in producing this - just set them how I generally like my figures. I'm using OpenGL, which I believe is part of the problem since I don't recall having these issues when working on a hardware accelerated system. Running 9.2.0.556344 (R2017a) on Win7 64-bit i7 system with Intel HD 530 graphics - attaching sysinfo png.
Best regards,
/Jonas
%cropcircledemo.m set(0,'DefaultAxesFontsize',12); set(0,'DefaultLineLinewidth',2); set(0,'DefaultLineMarkersize',10);
x=[0.1009 0.1011 0.1020 0.1613 0.2339 0.3051 0.3654 0.4284 0.4901 0.5798 0.6720 0.7530 0.8240 0.1007]; y=[14.6900 14.8100 15.0500 15.2800 15.5200 15.7400 15.9300 16.1400 16.3300 16.6100 16.9100 17.1700 17.4000 14.6900];
figure(10); clf; plot(x,y,'o');
print cropcircledemo.png -dpng -r600

采纳的回答

Michael Dombrowski
Michael Dombrowski 2017-6-29
Your issue can be resolved by changing either the resolution (DPI) or the renderer.
Try the following code:
% do not use opengl
print cropcircledemo.png -dpng -r600 -painters
% use any other dpi
print cropcircledemo.png -dpng -r700
  1 个评论
Jonas Gustavsson
Jonas Gustavsson 2017-6-29
Thanks Michael! I would call these work-arounds, but I'll still accept the answer - hopefully later Matlab versions will improve the handling of this - don't believe it used to behave like this.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by