title: Matlab: How to avoid artefacts in filled contour plots
body: <p>I am trying to export filled contour plots from Matlab as vector graphics to include in a Latex file. My current methodology is:</p>
  
  <pre><code>contourf(x,y,v_mag,20), axis([0,width,0,height]),daspect('manual') ;
  grid off
  colormap jet
  h = colorbar;
  caxis([0 v_lid])
  h.Label.String = 'Velocity Magnitude (m/s)';
  set(gcf,'renderer','painters')
  export_fig('-painters', '-transparent', 'pdf', 'filename.pdf');
  </code></pre>
  
  <p>The problem with this method is that it produces artefacts (the white lines) which look like the following:
  <img src="https://i.stack.imgur.com/prH06.png" alt="Artefacts in PDFs produces from Matlab"></p>
  
  <p>I understand that these white lines are the polygons defining the shaded areas which have invisible edges, and don't quite overlap <a href="http://pages.uoregon.edu/noeckel/MathematicaGraphics.html#ExportShading" rel="noreferrer">(according to here)</a>. The problem is caused by the pdf viewer itself which tries to smooth the lines displayed on the screen <a href="http://www.mathworks.com/matlabcentral/answers/15388-artifacts-in-figures-exported-as-pdf-from-matlab" rel="noreferrer">(according to here)</a>. My problem is that most people viewing the document will not know this and will not know how to prevent the viewer doing this. So my questions is:</p>
  
  <p>Is it possible to create a vector graphic of a filled contour plot from Matlab without these artefacts? </p>
  
  <p>Eps produces the same problems. I have tried to use the <a href="http://uk.mathworks.com/matlabcentral/fileexchange/7401-scalable-vector-graphics--svg--export-of-figures" rel="noreferrer">SVG function</a> but have not had any luck. I am trying to avoid using raster graphics due to the pixelation caused by zooming in. Any advice would be much appreciated.</p>
  
  <p><em>EDIT</em> - Additional info - Using Matlab v.2014b and Ghostscript v.9.15</p>