MATLAB: Bug eps, pdf matlab 2014b surface plot (contourf)

contourfepsexportfigureMATLABpdfsurface

Hi all, with matlabR2014b I got very bad quality eps and pdf files for surface plots.
)
But using the same script with MatlabR2014b I got very bad quality figures (white lines, bad dot size using plot3D, and very large size for the file: the eps from R2014b is 40x larger than the eps from R2014a!): http://lhoupert.fr/files/others/matlab/bugfig2014b/figR2014b.eps and http://lhoupert.fr/files/others/matlab/bugfig2014b/figR2014b.pdf <http://lhoupert.fr/files/others/matlab/bugfig2014b/figR2014b.pdf>
Do you know if this bug is fixed / will be fixed in the more recent versions of Matlab (>=R2015a)?

Best Answer

Hi Loïc,
Prior to R2014b, the MATLAB graphics system used a different process, with a different set of vector primitives, for exporting to vector formats such as EPS and PDF. Unfortunately, these primitives could not always render every aspect of a MATLAB figure correctly. Also, other software, such as printer drivers, often had bugs in rendering these primitives. As a result, there were many reports of incorrect exported plots in earlier versions of MATLAB.
To solve these problems, the MATLAB graphics team revised the rendering pipeline to obtain more direct control over the vector output. The primary method was to use many small triangles. This procedure corrected earlier problems but had two undesirable effects:
  • It increased the output file size.
  • It caused white lines to appear when viewing the PDF or EPS files on screen. (The white lines do not affect printed output.)
The file size increased directly as a result of the increased number of primitives (small triangles).
The white lines are caused by bugs in widely-used PDF and EPS viewers. The antialiasing method in these viewers does not handle correctly the case where two same-color polygons share a common edge. The white lines are appearing at these common edges.
Compensating for bugs in external viewers has proved challenging, but MATLAB R2015a has improved the situation somewhat by grouping triangle strips together. A graphics developer who looked at your plots thinks that you will see improvement in the visual quality and file size with R2015a, although the problems might not be solved completely.
Related Question