0

Hi guys im trying to build a graphic bar with gnuplot. I have to put the graphic in a png file and then present it in html page. Im having problems with using the plot command in my script.

If you know to use gnuplot commands in a script, i would aprecciate your help!

1
  • 2
    "Im having problems with using the plot command in my script." could you show your current script what yu got so far? Commented Apr 17, 2021 at 16:04

1 Answer 1

1

You can easily use gnuplot commands within an interactive shell, on in a shell script:

echo 'set term pngcairo; set output "file.png"; plot x' | gnuplot

You could also put your commands in file.gnuplot and then execute

gnuplot file.gnuplot

from within your shell script or interactive shell. If instead of writing to file you just want the graph to pop up using the default gnuplot terminal, you can add -persist:

echo 'plot x' | gnuplot -persist

You can also use shell commands inside a gnuplot script or gnuplot interactive session via a system() call, but that's a separate topic.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.