Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Blurred heatmap image with eps output

568 views
Skip to first unread message

Jeff Terrell

unread,
Apr 3, 2009, 9:52:10 AM4/3/09
to
(Note: I emailed this message to gnuplo...@lists.sourceforge.net
last night, but it didn't seem to be delivered successfully. My
apologies if this is a duplicate.)
----------------------------------------

Hello, gnuplot wizards,

I've found a discrepancy between png and postscript (eps) terminals
when plotting an "image" heatmap. The png version produces a nice,
sharp boundary between the colors, but the postscript version produces
a very blurred image. I want the postscript version to be like the
png version, because the blurriness makes it very hard to understand.
And I'd really hate to include a yukky ol' png image in my pretty
LaTeX document... :-)

I get the same results using gnuplot 4.2 patchlevel 3 and the current
(as of April 2) CVS source, which lists its version number as 4.3
patchlevel 0.

I've included a minimal example demonstrating this discrepancy below.
Here is the png output of the code:
http://wwwx.cs.unc.edu/~jsterrel/gnuplot/heatmap.png
and [a screenshot of] the eps output:
http://wwwx.cs.unc.edu/~jsterrel/gnuplot/blurry.png

========== example start ==========
#set terminal postscript eps color 20
#set output "blurry.eps"
set terminal png
set output "heatmap.png"
set nokey
plot '-' using 2:1:3 notitle with image
1 1 1
1 2 1
1 3 1
1 4 2

2 1 1
2 2 3
2 3 5
2 4 5

3 1 1
3 2 1
3 3 1
3 4 4

4 1 1
4 2 1
4 3 1
4 4 5

========== example end ==========

Any help would be appreciated!

Thanks,
-Jeff T.

P.S. Thanks for providing such a useful tool! I use gnuplot on a
daily basis, and I love it!

Juergen Wieferink

unread,
Apr 3, 2009, 10:52:13 AM4/3/09
to
I cannot reproduce your problem with neither 4.2 nor 4.3. Please
retry your test script from scratch. I guess there were some old
settings still active or you have not closed your eps file (set
output) inbetween.

Juergen

sfeam

unread,
Apr 3, 2009, 11:23:18 AM4/3/09
to
Jeff Terrell wrote:


> I've found a discrepancy between png and postscript (eps) terminals
> when plotting an "image" heatmap. The png version produces a nice,
> sharp boundary between the colors, but the postscript version produces
> a very blurred image.

I very much suspect that your postscript output is correct, and it is
your viewing program that causes the blurring. Have you tried sending
the output to a PostScript printer?

Petr Mikulik

unread,
Apr 3, 2009, 6:08:41 PM4/3/09
to Jeff Terrell
> I've found a discrepancy between png and postscript (eps) terminals
> when plotting an "image" heatmap. The png version produces a nice,
> sharp boundary between the colors, but the postscript version produces
> a very blurred image. I want the postscript version to be like the
> png version, because the blurriness makes it very hard to understand.
> And I'd really hate to include a yukky ol' png image in my pretty
> LaTeX document... :-)

You are probably using ghostview and have antialiasing switched on. Then it
is a bug in ghostscript. Hit "a" if you are running "gv" (on unix) to switch
antialiasing on/off, other viewers have it as an option somewhere.

You can find discussion about this issue as "spurious lines in gs with
antialiasing". In July 2005, I've filled this bug report:
http://bugs.ghostscript.com/show_bug.cgi?id=688243
Summary: Spurious lines between joined filled rectangles and antialiasing
They discussed it in 2005 and 2007 but the problem is still unsolved.

---
Petr Mikulik

Jeff Terrell

unread,
Apr 3, 2009, 9:17:00 PM4/3/09
to
On Apr 3, 11:23 am, sfeam <sf...@users.sourceforge.net> wrote:
> > I've found a discrepancy between png and postscript (eps) terminals
> > when plotting an "image" heatmap. The png version produces a nice,
> > sharp boundary between the colors, but the postscript version produces
> > a very blurred image.
>
> I very much suspect that your postscript output is correct, and it is
> your viewing program that causes the blurring. Have you tried sending
> the output to a PostScript printer?

Ah. You're right! I was using Preview.app in OS X to view the
files. Adobe Reader and ghostscript both give me sharp boundaries
between the boxes.

Unfortunately, they also allow the text to remain aliased, which makes
them nearly unreadable. Maybe I will have to output to a png terminal
and convert after all. I hate defiling my beautiful vector-y PDF with
bitmapped images, but oh well. :-/

On Apr 3, 6:08 pm, Petr Mikulik <miku...@physics.muni.cz> wrote:
> You are probably using ghostview and have antialiasing switched on. Then it
> is a bug in ghostscript. Hit "a" if you are running "gv" (on unix) to switch
> antialiasing on/off, other viewers have it as an option somewhere.
>
> You can find discussion about this issue as "spurious lines in gs with
> antialiasing". In July 2005, I've filled this bug report:
>  http://bugs.ghostscript.com/show_bug.cgi?id=688243
>   Summary: Spurious lines between joined filled rectangles and antialiasing
> They discussed it in 2005 and 2007 but the problem is still unsolved.
>
> ---
> Petr Mikulik

Thanks for the additional info, Petr. After reading through the
comments there, I'm convinced that this is a rabbit hole I don't need
to go down at the moment. :-) But it's good to know that the problem
isn't with trusty ol' gnuplot.

Thanks everyone,
-Jeff T.

Petr Mikulik

unread,
Apr 4, 2009, 8:20:17 AM4/4/09
to Jeff Terrell
> Unfortunately, they also allow the text to remain aliased, which makes
> them nearly unreadable.

Ghostscript has an option to set independently antialiasing for text and for
other drawing elements.

> Maybe I will have to output to a png terminal and convert after all. I
> hate defiling my beautiful vector-y PDF with bitmapped images, but oh
> well. :-/

Then you can try pdf output.
When this file is displayed in xpdf or gv, the same bug appears.
But when it is displayed in Acrobat or FoxitReader, then it is correct.

---
PM

0 new messages