Search code examples
gnuplotpostscript

gnuplot postscript terminal not showing transparent symbols


Hopefully, this is a stupid question, and easy to fix. When I run this simple gnuplot script:

#!/usr/bin/env gnuplot

set term png
set out "out.png"

plot "<jot -r -p 2 500 1 2" not w p pt 7 ps 4 lc rgb "#908DB6CD"

set term post eps enhanced color
set out "out.eps"

replot

exit

The png file looks like this:

png output

And the eps looks like this:

eps output

The pdfcairo terminal also gives me transparency. Any clues on how to make the eps files show transparency?

Many thanks in advance!


Solution

  • I think I should respond to my own question, so at least this becomes a case closed.

    After some more digging, and from the comments I received, the bottom line is that the gnuplot postscript terminal does not handle transparency, while the pdf and pdfcairo terminals do.

    The trick is to generate an .eps file from a .pdf using pdftops:

    #!/bin/bash
    
    gnuplot << GNU
    
    set term pdf
    set out "out.pdf"
    
    plot "<jot -r -p 2 500 1 2" not w p pt 7 ps 4 lc rgb "#908DB6CD"
    
    GNU
    
    pdftops -eps out.pdf
    

    All of my .eps files are generated to be incorporated to LaTeX documents. Then, I could just switch to PDFLaTeX and be over with it. However, at times I like to edit the .eps to tweak the bounding box and other things by hand or using awk/sed. Anyway, hope this is helpful.