I want to draw graph using gnuplot and TikZ with the source (this is MWE) shown below, but it didn't work for me.


In this code, sin.tex is generated by this gnuplot's code:

set terminal tikz solid
set output "sin.tex"
plot sin(x)

The following image is the outcome.

enter image description here

However, gnuplot's plot sin(x) outputs sine curve when the terminal is aqua. Can anyone solve this probem?

Sorry for my bad English.

  • Your MWE works for me. Despite some undefined color errors, the result looks like a sine wave. Are there any errors in your latex log file?
    – Harald
    Oct 27, 2014 at 13:34
  • Thank you for the comment. There is no error but so many warnings, and most of them are ** WARNING ** Interpreting special command ps: (ps:) failed. ** WARNING ** >> at page="1" position="(foo, bar)" (in PDF) ** WARNING ** >> xxx "ps:: restore " ** WARNING ** Unknown token "restore" ** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
    – Merzong
    Oct 27, 2014 at 15:11
  • I've posted my assumption of the problem as an answer. If that was not the problem then you might have to give further details about it, such as which OS, tex distribution, compiler, version numbers, etc. you use.
    – Harald
    Oct 30, 2014 at 10:03

1 Answer 1


It seems to me, that the "tikz" terminal of gnuplot is intended for the pdflatex compiler and you use the latex compiler to get a intermediate .dvi file.

Please try the pdflatex compiler or the "pslatex" terminal in gnuplot

  • I don't know the exact reason of this error, but I get what I desired after uninstalling and re-installing gnuplot. I use e-upLaTeX and this compiler usually has no problem with TikZ. Thanks anyway :)
    – Merzong
    Oct 31, 2014 at 5:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .