Strange lines in PDF maps


Often when I create a map using GMT, and then convert it to PDF, I see the page background “bleed” through in thin lines which look like the map grid. These lines aren’t present in the EPS version or raster image versions. Here’s an example screenshot illustrating the effect:

And here’s the code which generated it:

#!/usr/bin/env bash
# Plot a Southern Hemisphere version the UN emblem

gmt begin unlogo pdf,png,eps A+m0.5c
  gmt gmtset PS_PAGE_COLOR          57/138/220
  gmt gmtset MAP_GRID_PEN_PRIMARY   3p,214/157/54
  gmt gmtset MAP_POLAR_CAP          60/400

  gmt subplot begin 1x2 -Fs20c/20c+g57/138/220
    gmt subplot set
      gmt coast -JE0/90/150/20 -Rg -G214/157/54 -Swhite \
        -B -Bpxg45 -Bpyg30 -Dc -A50000/0/2
    gmt subplot set
      gmt coast -JE0/-90/150/20 -Rg -G214/157/54 -Swhite \
        -B -Bpxg45 -Bpyg30 -Dc -A50000/0/2
  gmt subplot end

gmt end

Does anyone know how to remove these lines? Even using a white page background doesn’t fully solve the problem, because the lines bleed through in the land areas.

I tried increasing the PDF resolution to 3600 dpi, but this didn’t help.

And incidentally, the diagonal lines at the bottom left corner of each frame are something else … these appear in the raster images too. Is this a bug with the Azimuthal Equidistant map plotting?


Tim Hume

Hi Tim, usually this is an issue with the anti-aliasing settings on a PDF viewer and not something wrong with the plot. At least in my experience. The coordinates for the abutting polygons are exactly the same - no gap, but viewers may round things in funny ways.

Thanks Paul,

That solved it. I was using a PDF viewer called Okular, but when I changed back to gv, things were perfect. The diagonal line at the bottom left of the frames remained though.



Sorry, a few more things: My output does not have the white oceans, which is puzzling. I get all blue and in the PDF no lines whatsoever (mac Preveiw), but the diagonal lines are there in PNG and ghostview. I will look at this some more once some zoom meetings are over with.

The common factor in much of this is ghostscript. They have had a large number of bugs come and go the last year, so we usually trace problems back to those unfortunately,

I’m using the latest version of Fedora, which I guess must have a reasonably up-to-date ghostview.

I made these plots for just a bit of fun last night. I guess that given this year is the 75th anniversary of the United Nations, it’s about time the Southern Hemisphere gets its fair share of recognition. :slight_smile:

The problem turned out to be a failure in our -JE map clip path and that give those ghost diagonal lines. The other lines are ghostscript related. Fix will be merged soon []. Thanks for pointing this out!

That pull request has not been merged so please work from GMT master in the repo and your troubles should be over.