Home  /  Resources & support  /  FAQs  /  Line artifacts in filled contour plot

Why do I see small line stripes in my filled contour plot?

Title   Line artifacts in filled contour plot
Author Hua Peng, StataCorp

When viewing a filled contour plot on Linux and Mac, the graph may show small line stripes that look like scratches. The same symptom may occur when viewing exported EPS or PDF files of a filled contour plot.

These line stripes are an artifact due to anti-aliasing. Stata graph windows on Mac and Linux have anti-aliasing enabled, as do many PostScript and PDF viewers. This causes these line stripe artifacts to occur. The problem is limited: it only appears when viewing the graph or exported EPS/PDF file on the computer screen. If you print the file, you will not see the line stripe artifacts.

We have included special logic in the code to reduce the artifacts that appear on Linux and Mac machines. Stata graph windows on Microsoft Windows do not suffer from anti-aliasing because these windows do not support it.

You can prevent the artifacts when viewing an affected file by turning off anti-aliasing support on the PostScript or PDF viewer.

Here are instructions for turning off anti-aliasing on some popular PostScript and PDF viewers:

  1. GSView:
    From the Media > Display Settings menu, change "Graphics Alpha" to 1 Bit.
  2. Adobe Reader 9 and 10:
    From the Adobe Reader > Preferences... menu, select the “Page Display” pane, uncheck “Use 2D graphics acceleration”, and uncheck “Smooth line art”.
  3. Adobe Illustrator:
    From the Illustrator > Preferences... > General menu, unselect “Anti-Aliased Artwork”.
  4. Mac Preview:
    From the Preview > Preferences... menu, select the “PDF” pane and uncheck “Smooth text and line art”.