When I use Tikz to plot a function. I followed the instruction to use gnuplot to do so. I did that half year before. But now when I recompile, the gnuplot has problem with the first line of its generated .gnuplot file:

set terminal table

Does anyone know the problem? My gnuplot version is 4.4 patchlevel 2. Do I need to use an older version?

Thank you very much!

EDIT: my file is here:

A minimal example







\draw[help lines,step=1] (0,-3) grid (5,5.5);
\draw [->] (-0.5,0) -- (0,0) coordinate [label=-135:$O$] (O) -- (6,0)
coordinate [label=right:$t$] (T);
\draw [->] (0,-3.2)  -- (0,6) coordinate [label=above:$x$] (X);

\draw [dashed,thick] (0,\xI) coordinate [label=left:$x_1$] -- (\tI,\xI) --
(\tI,0) coordinate [label=below:$t_1$] ;
\draw [dashed,thick] (0,\xII) coordinate [label=left:$x_2$] -- (\tII,\xII) --
(\tII,0) coordinate [label=below:$t_2$] ;

\foreach \r in {-3,-2,-1,0,1,2,3}
\draw plot [id=HeatSample-\r]
) * \r} node [right] {$\r$};


Even with the basic examples in http://www.texample.net/tikz/examples/tag/gnuplot/, my system has problems with

set terminal table;

I think it is the problem of my gnuplot


Following up on Thorsten's answer, a work around is to explicitly change this in the pgf file that calls gnuplot. For my texlive installation, the file I had to change is:


Change this line:

\xdef\pgf@gnuplot@head#1{set terminal table; set output "#1.table"; set format "%.5f"}

to this:

\xdef\pgf@gnuplot@head#1{set table; set output "#1.table"; set format "%.5f"}
| improve this answer | |

Make sure that you have Version 2.10 of pgf/tikZ installed to make it work with current versions of Gnuplot. In these versions (I guess since 4.4.0) the setting of the »table« terminal in Gnuplot has changed from set terminal table to set table. Actually there should be some information about that in the log file.

| improve this answer | |
  • Yes, It is. Now it works. Thanks a lot! :-) – Anand Jul 23 '11 at 13:32

After reading the post: TikZ + gnuplot on a Mac

I change the line

\xdef\pgf@gnuplot@head#1{set terminal table; set output “#1.table”; set format “%.5f”} 


\xdef\pgf@gnuplot@head#1{set table; set output “#1.table”; set format “%.5f”} 

in the file /usr/share/texmf/tex/generic/pgf/modules/pgfmoduleplot.code.tex.

Then it works well again.

Thanks Thorsten!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.