I have a program that generates data with a couple of input arguments and spits it out to stdout, I pipe this data to gnuplot and plot it (in my case I don't have an intermediate file):
$ cat sample_data.dat | gnuplot plot_script.gp
sample_data.dat:
0 0.5000
1 0.9225
2 0.2638
3 0.7166
4 0.7492
plot_script.gp
#!/usr/bin/gnuplot
set terminal wxt size 700,524 enhanced font 'Verdana,10' persist
set style line 1 lc rgb '#0060ad' pt 7 lt 1 lw 0.5 # circle blue thin line
set style line 2 lc rgb '#949599' lt 1 lw 1 # --- grey
plot "<cat" using 1:2 w lp ls 1 notitle
what I want to accomplish is something like this
plot "<cat" using 1:2 w l ls 2 notitle, \
"" using 1:2 w p ls 1 notitle
That is, I want the line in one colour and the dots in another. I just can figure out a solution for this.
Could I read the stdin to a variable to store it so I could plot it twice?
There are some close questions on stackoverflow but nothing that I could really use to figure out to fit my problem, gnuplot-plot-two-data-set-from-stdin and pipe-plot-data-to-gnuplot-script
Edit:
I have now tried this as well:
plot for[col=2:3] "<awk '{print $1,$2,$2}'" using 1:col w lp ls col notitle