matlab - unknown white lines when saving pie chart as pdf -
when save pie chart pdf, pdf has unknown white lines. simplify question, modify code generic form following.
clc; h=pie(1); %set pie chart color black h(1).facecolor = 'k';
the reason choose use black color white lines contrast black background. please see attached pdf figure.
i find similar thread having same issue @ link: weird artifacts when saving pie chart pdf. no solution provided @ point.
my system configuration: macos sierra version 10.12. matlab r2016b.
any input welcome. thank you.
i found adding one of these, after call pie
, such, took care of problem:
set(gcf,'renderermode','manual');
set(gcf,'renderer','opengl');
set(gcf,'renderer','opengl','renderermode','manual');
it strange because if try get(gcf,'renderer')
show opengl
(at least on machine), interpreted painters algorithm until render mode switch manual. happens automatically if set renderer opengl, or can set render mode manual , (matlab) takes @ renderer property.
here's proof of concept
clc; h=pie(1); %set pie chart color black h(1).facecolor = 'k'; % set(gcf,'renderermode','manual'); set(gcf,'renderer','opengl','renderermode','manual') saveas(gcf,'pie.pdf');
i had convert image have show here, .pdf looks same (i.e. no white lines).
Comments
Post a Comment