Reputation: 21
I have to plot a graph using gnuplot
with the help of shell script.
I have written this code but its not working. I want to plot the graph in a html file so that I can see that graph in browser.
echo "set term canvas mousing size 500, 500
set output "file_name.html"
plot 'my_file.txt' with lines" | gnuplot
I have saved this file in .bash on the desktop. Now I wrote this in terminal but it didn't work
sh file_name.bash
Please someone help me out with this. I am totally stuck with this thing since yesterday. :-(
Upvotes: 2
Views: 8876
Reputation: 7468
There are multiple errors,
echo
which will not work. change it to single-quotesgnuplot
commandsSo resulting script should be something like this
echo "set term canvas mousing size 500, 500; set output 'file_name.html'; plot 'my_file.txt' with lines" | gnuplot
or
cat << __EOF | gnuplot
set term canvas mousing size 500, 500
set output "file_name.html"
plot 'my_file.txt' with lines
__EOF
Upvotes: 2