TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
Thanks Marco for your editing. :-) – Anand Jul 23 '11 at 12:56
up vote 3 down vote accepted

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"}
share|improve this answer
Thanks cm2, We post the answer in the same time. :-) – Anand Jul 23 '11 at 13:36

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.

share|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!

share|improve this answer
Why don't you just update the pgf/tikZ package? – Thorsten Donig Jul 23 '11 at 13:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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