I'm writing a code in c++ which plots a dataset using gnuplot, and I realized that I could simplify my code a lot if I could get variables from gnuplot to my c++ code. e.g. if I did a fit f and get his stats i.e.
f(x)=a*x+b
fit f 'data.txt' via a,b
stats 'data.txt' u (f($1)):2 name 'Sf'
Is there any way to get, for example, the Sf_records and save it to a variable in my code? Like int N = Rf_records
?
Thanks for your help
Assuming that you are communicating with
gnuplot
trougth aFIFO
, you can order to gnuplotand you can read this to your
c++
program.Eg. for reading a varirable:
To open a
gnuplot
FIFO