MATLAB and high quality EPS figures

前端 未结 4 544
天涯浪人
天涯浪人 2020-12-08 16:56

I am looking to export my MATLAB plot as a high quality figure. Specifically, I would like to save it as a vector based file format such as EPS or SVG.

I hav         


        
4条回答
  •  感动是毒
    2020-12-08 17:22

    I thought I would share the issue I had, and how I overcame it...

    I was getting terrible results because I had the wrong renderer set to default. In my startup.m, I had the zbuffer renderer enabled. This is an example eps output.

    Crop of output eps

    I made that eps output with: print(gcf,'-depsc2','filename.eps'). This eps is so OBVIOUSLY rasterised. It makes me angry at matlab. Then, I had a brainwave - perhaps my default renderer zbuffer is interfering with the image save process. So, adding the line:

    set(gcf,'renderer','painters')
    

    and running the print command as before, here is the output:

    Crop of second output eps

    Note that I just took screenshots of the eps output files at 100%. And I can confirm the second image is actually vector. Here is a good question/explanation on choosing Renderers in MATLAB.

提交回复
热议问题