I have this bash script:
#!/bin/bash
foo=42
./test.gp
And this is the gnuplot script (test.gp
):
#!/usr/bin/gnuplot
set grid
set title "This is the title (`echo $foo`)"
set terminal png large
set output "/tmp/test.png"
set samples 50, 50
plot [-10:10] sin(x)
I'm led to believe that this should display the title as This is the title (42)
. But it doesn't.
The resulting image looks like this:
Also I want to
plot [-10:10] sin(x + `echo $foo`)
But that results in an error:
plot [-10:10] sin(x+)
^
"./test.gp", line 9: invalid expression
I use gnuplot 4.6.
EDIT: moved solution to separate answer as requested in the comments.