Menu

set terminal postscript eps changed?

Help
2006-04-11
2013-02-10
  • Morten MacFly

    Morten MacFly - 2006-04-11

    Dear all,
    I guess I'm missing something really basic, so hopefully someone can help me. With Gnuplot v4.00 and below I was able to create an EPS plot using:
    set terminal postscript eps
    set output "sinx.eps"
    plot sin(x)
    This does not work with a current snapshot of the 4.1 branch from CVS. The eps file is created but if I view it with gsview (Windows) then it is empty. Am I missing something (a new syntax?!) here or is this broken?
    With best regards, Martin.

     
    • Hans-Bernhard Broeker

      The problem is that your command sequence is incomplete.  It only worked in pre-4.0 versions by happenstance, not by design. 

      You try to open the file before gnuplot is done writing it.  Do

         set output    # no file name!

      in gnuplot, to close the file, before you go on displaying the EPS, and it'll work.

       
      • Morten MacFly

        Morten MacFly - 2006-04-11

        Thank you for the fast answer. Unfortunately this did not resolve the problem but got me a step further:
        I forgot to mention that I'm running "wgnuplot sinx.plt" which runs gnuplot with the plot file, and exists gnuplot, so the file handle is released properly when I open it with gsview. Nevertheless I have changed my file now to:
        set terminal postscript eps
        set output "sinx.eps"
        plot sin(x)
        set output
        But what I (stupidely) never tried is to open gnuplot and do a "load 'sinx.plt'". If I do this I encounter the following error:
        Can't find PostScript prologue file          "sinx.plt", line 3: prologue.ps

        I never tried that because the EPS file produced the first (the "command line") way was really creating an EPS file which was valid (not zero filesize). Only the view is empty. I've attached the EPS file below for your reference (I hope this helps).

        With regards, Martin.

        EPS-file produced:
        %!PS-Adobe-2.0 EPSF-2.0
        %%Title: sinx.eps
        %%Creator: gnuplot 4.1 patchlevel 0
        %%CreationDate: Tue Apr 11 14:52:46 2006
        %%DocumentFonts: (atend)
        %%BoundingBox: 50 50 410 302
        %%EndComments
        /gnudict 256 dict def
        gnudict begin
        %
        % The following 6 true/false flags may be edited by hand if required
        % The unit line width may also be changed
        %
        /Color false def
        /Blacktext false def
        /Solid false def
        /Dashlength 1 def
        /Landscape false def
        /Level1 false def
        /Rounded false def
        /gnulinewidth 5.000 def
        /userlinewidth gnulinewidth def
        %
        /vshift -46 def
        /dl1 {
          10.0 Dashlength mul mul
          Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
        } def
        /dl2 {
          10.0 Dashlength mul mul
          Rounded { currentlinewidth 0.75 mul add } if
        } def
        /hpt_ 31.5 def
        /vpt_ 31.5 def
        /hpt hpt_ def
        /vpt vpt_ def
        Level1 {} {
        /SDict 10 dict def
        systemdict /pdfmark known not {
          userdict /pdfmark systemdict /cleartomark get put
        } if
        SDict begin [
          /Title (sinx.eps)
          /Subject (gnuplot plot)
          /Creator (gnuplot 4.1 patchlevel 0)
          /Author (ftmh)
        %  /Producer (gnuplot)
        %  /Keywords ()
          /CreationDate (Tue Apr 11 14:52:46 2006)
          /DOCINFO pdfmark
        end
        } ifelse

         
    • Morten MacFly

      Morten MacFly - 2006-04-11

      I've go it!

      Using filemon I realised that wgnuplot.exe looks for the prologue.ps file in /usr/local/share/gnuplot/4.1/PostScript and in the environment variable "GNUPLOT_PS_DIR". So the first thing I've forgotton was to copy the Postscript folder (that includes prologue.ps and others) from the CVS folder into the gnuplot directory (simply because it does not exist in the 4.00 release). Then I setup the GNUPLOT_PS_DIR variable accordingly and it works again.

      This raises a question: Is there somewhere mentioned what files in what folder structure have to be distributed if I compiled gnuplot myself?!

      Thanks again for your help.

      With regards, Martin.

       
    • Morten MacFly

      Morten MacFly - 2006-04-11

      Another addition:
      I found information about (further) possible environment variables in the INSTALL file. Anyway, GNUPLOT_PS_DIR is not mentioned there so far. I guess it would be helpful to add that information. Maybe in addition the error message "Can't find PostScript prologue file (...)" could also mention that GNUPLOT_PS_DIR is probably not setup correctly. That would be in post.trm in the "PS_dump_prologue_file" function. But these are just my thoughts.
      Anyway, I'm really happy that I can switch to 4.1 now finally (for me that is).
      With best regards, Martin.

       
      • Hans-Bernhard Broeker

        Well, suffice it to say that updating documentation and/or makefiles for platforms they don't habitually use (like MS Windows) not exactly your typical developer's favourite pastime.  I.e. it tends to be overlooked.  The PS prologue stuff is in CVS for a rather short time --- details like that haven't been ironed out yet.

         

Log in to post a comment.

Monday.com Logo