Why do 3D plots become pixelated after exporting to SVG, while 2D plots do not?
7 次查看(过去 30 天)
显示 更早的评论
I created a 2D and a 3D plot using the attached code and saved them in SVG format. I then inserted both into a LaTeX document using the same command. However, in the resulting PDF, it looks like only the 2D plot is vector based (as intended), while the 3D plot appears to be pixelated. Can anyone tell me why?

0 个评论
回答(1 个)
Divyanshu
2025-1-21
A possible cause for the issue can be MATLAB switiching the auto-renderer setting to '-opengl' to render the plot. This generally happens when the number of elements exceed a certain threshold in the figure.
The workaround is to manually force the '-vector' renderer, this should give correct graphics output. You can try adding the following command to the script and observe the results:
print(hfig,'-vector','-dpdf',[fname,'.pdf'])
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!