weird artefacts when saving piechart as pdf
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everybody,
I'm currently trying to get a pdf-image of a piechart, but i'm running into some trouble. The problem is that the first slice seems regular, but then the rest of them have these weird artefacts. It happens with the saveas function, but the print function has the samen issues. Exporting to EPS format gives the same results. I have no clue where this effect comes from, so I'm hoping any of you guys can help me.
I have attached an image with the artefacts.
I'm using Matlab R2014b on Mac OSX 10.9. Thanks!
1 Kommentar
Shikicat
am 29 Jul. 2015
I have the same exact problem! Have you figured it out by any chance? I'm using MATLAB R2015a, Mac OSX 10.10.2. Thanks.
Antworten (1)
Informaton
am 4 Aug. 2017
I found adding any one of these, after your call to pie and such, took care of the problem:
- set(gcf,'renderermode','manual');
- set(gcf,'renderer','opengl');
- set(gcf,'renderer','opengl','renderermode','manual');
It is a bit strange because get(gcf,'renderer') shows opengl as the renderer (at least on my machine), however it is interpreted as a painters algorithm until the render mode is switch to manual. The render mode is switched to manual automatically if you manually set the renderer to opengl. Or you can just set render mode to manual and then it (MATLAB) actually takes a look at the renderer property.
Here's proof of concept:
clc;
h=pie(1);
%set the pie chart color to black
h(1).FaceColor = 'k';
% set(gcf,'rendererMode','manual');
set(gcf,'renderer','opengl','renderermode','manual')
saveas(gcf,'pie.df');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!