low quality figure problem when saving as svg or pdf ( using fill function)

조회 수: 190 (최근 30일)
Hello,
I tried to look through this problem but couldn't find a solution, maybe I am missing something.
The problem happens when creating a figure with "fill" function. When the inputs are small matrices there is no problem and I can get high res images both in svg and pdf format however when bigger matrices are used image gets pixelated and blurry.
A simple example is as follows:
x=rand(10,10);
y=rand(10,10);
z=rand(10,10);
figure,axis equal,
fill(x,y,z)
x1=rand(50,50);
y1=rand(50,50);
z1=rand(50,50);
figure,axis equal,
fill(x1,y1,z1)
When saving those figures in svg or pdf format I get this problem. The figure created using 50x50 matrix becomes low quality.
Did anyone come upon this problem? I would appreciate if somebody points methe right direction.

채택된 답변

Anton Kogios
Anton Kogios 2023년 3월 7일
This issue occurs when the figure is quite complex, like your second one. One solution is to force a vectorised export by going to, in your figure window, File > Export Setup... > Rendering (under Properties) > select 'Custom renderer' and 'painters (vector format)' from the dropdown list > Export > save it as svg or pdf as you wish.
NB: it may take a while to generate, and the background colour to the figure window will turn white while it is doing so.
  댓글 수: 2
Oguz Korman
Oguz Korman 2023년 3월 7일
Thanks for the reply Anton. I tried and this actually worked. It took some time as you wrote but its okay. Thing is the size of the images are now very high but probably there are not solutions to that.
Doaa Mahmoud
Doaa Mahmoud 2023년 9월 25일
Thank you so much for your comment; it really helped me with that problem. I searched for a long time, but your answer saved me. Thank you so much.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

David Hill
David Hill 2023년 3월 7일
How is the quality different? My saved pdf looks just the same.
x=rand(10,10);
y=rand(10,10);
z=rand(10,10);
figure,axis equal,
fill(x,y,z)
x1=rand(50,50);
y1=rand(50,50);
z1=rand(50,50);
figure,axis equal,
fill(x1,y1,z1)
saveas(gcf,'myfigure.pdf');
  댓글 수: 3
Oguz Korman
Oguz Korman 2023년 3월 7일
thanks for your answer David. I tried using the saveas as you did however when I zoom in the picture I still see pixelated lines and blurs. Don't know what is causing this.
I did try @Anton Kogios's suggestion and it worked. (though the size is very high now )
Oguz Korman
Oguz Korman 2023년 3월 7일
exactly, pdf size is like that. thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by