0

I'm using a headless gnuplot working great without X, but the problem is that it asks me to press enter after each plot so I can't do multiple plots in a script, they just don't generate when I try to do them without being able to press enter (with fork for example).

How can I plot headlessly without asking for the user to push enter?

CornSmith
  • 1,957
  • 1
  • 19
  • 35
  • 1
    Please be more precise and show some code of what you are doing. I've no idea... – Christoph May 22 '14 at 18:52
  • What's a `headless gnuplot`? What's `X` ? X Window System? Are you plotting from a script? From interactive shell ? What OS are you using? What version of gnuplot? What terminal are you using? Please show some effort... – kebs May 24 '14 at 16:27
  • I'm in linux. Say I have a script that calls 10 .plt files (gnuplot's format) which each plot based on a .csv file somewhere. If I try to run them they would all ask the user in the terminal to press enter and wait for it. Anyway, it's solved, see my answer. – CornSmith May 29 '14 at 02:13

1 Answers1

0

Final edit: The problem was actually that I was using the wrong gnuplot binary. It works "headlessly" fine even with no one there to press confirm. So no need to export GNUTERM. See my other question for more details on the gnuplot binary.

Old Answer:

export GNUTERM=dumb

This tells gnuplot not to ask the user for anything and just run. I think it should be on by default but whatever. I set this env variable before running my scripts and they just run now without asking for input.

Edit: while it solved the problem, it seems like this doesn't actually do what I'm saying it does. Apparently this just tells gnuplot to plot in ASCII format? It still outputs my pngs though.

Double edit: It may have been all due to using the wrong gnuplot binary actually.

Community
  • 1
  • 1
CornSmith
  • 1,957
  • 1
  • 19
  • 35
  • Hm, quite strange. The `dumb` terminal is an ASCII-based terminal, see [this output for `plot x`](http://i.stack.imgur.com/1k7Zu.png). So probably you're hiding some other problems with your terminal settings or other. – Christoph May 29 '14 at 14:07
  • Oh that is really neat looking though! Plotting to ascii format that is. – CornSmith May 29 '14 at 17:41