No text from epslatex terminal in gnuplot

2,658

PEBKAC. I thought the generated .eps file was supposed to be the final (standalone) output, but it is necessary to run pdflatex on the generated .tex file to properly render the plot with labels.

Share:
2,658
andyras
Author by

andyras

scientist!

Updated on January 25, 2020

Comments

  • andyras
    andyras almost 4 years

    I am trying to use the epslatex terminal in gnuplot, using the example code from this site.

    Copying and pasting this example and running the gnuplot script produces the following output: naked plot

    No labels! This happens under Ubuntu 11.10 using gnuplot 4.4.4 and under Arch using gnuplot 4.6.0.

    Looking at the output .tex file it seems that the label text is there in the file, but might be put outside the plot area:

    \begin{picture}(5040.00,3772.00)%
      \gplgaddtomacro\gplbacktext{%
        \csname LTb\endcsname%
        \put(860,1122){\makebox(0,0)[r]{\strut{}$-1$}}%
        \put(860,2086){\makebox(0,0)[r]{\strut{}$0$}}%
        \put(860,3049){\makebox(0,0)[r]{\strut{}$1$}}%
        \put(980,440){\makebox(0,0){\strut{}$-2\pi$}}%
        \put(1875,440){\makebox(0,0){\strut{}$-\pi$}}%
        \put(2770,440){\makebox(0,0){\strut{}$0$}}%
        \put(3665,440){\makebox(0,0){\strut{}$\pi$}}%
        \put(4560,440){\makebox(0,0){\strut{}$2\pi$}}%
        \put(160,2085){\rotatebox{-270}{\makebox(0,0){\strut{}$y$}}}%
        \put(2770,140){\makebox(0,0){\strut{}$x$}}%
      }%  
      \gplgaddtomacro\gplfronttext{%
        \csname LTb\endcsname%
        \put(3725,3238){\makebox(0,0)[r]{\strut{}$\sin(x)$}}%
      }%  
      \gplbacktext
      \put(0,0){\includegraphics{terminal_epslatex-inc}}%
      \gplfronttext
    \end{picture}
    

    Any ideas as to why there would be no label text visible here?

    • sebschub
      sebschub over 11 years
      The linked example works for me. Indeed, I get other positions for the label with gnuplot 4.4 patchlevel 3 on OpenSuse 12.1. Here is my tex file. Don't know why you get a faulty tex file, though... Are there any gnuplot configuration files?
    • Admin
      Admin almost 11 years
      Try to delete the line \gplfronttext.