I write a code in Fortran that allows me to draw data directly from a file using gnuplot.
write(10,*) 'plot "Test18.Stop.TXT" u 1:8 title "Force" lt -1 lc rgb "#808080" w lines'
I want to change the name of the data file every time I compile. The problem is that I do not know how to enter the file name as a variable. I have made a few attempts, such as:
open(11,file=Filename)
write(10,*) Filename
write(10,*) 'plot '<Filename>' u 1:8 title "Force" lt -1 lc rgb "#808080" w lines'
close(11)
and
open(11,file=Filename)
write(10,*) Filename
write(10,*) 'plot "'Filename'" u 1:8 title "Force" lt -1 lc rgb "#808080" w lines'
close(11).
Filename is a character which has the name of the file data, which should be drawn. When I compile it, I get always this error Error: Syntax error in Write statement at <1> (i.e. at File name).