我有一个桁架桥,我想用fortran 90和Gnuplot绘制,但是如果相应的数组元素大于或小于零,则桁架元素应该更改颜色。
open(10,file='plot_2D.plt')
write(10,*) 'set title " truss"'
write(10,*) 'set xrange [0:300]'
write(10,*) 'set yrange [0:40]'
write(10,*) 'set xlabel "x [U]"'
write(10,*) 'set ylabel "y [U]"'
write(10,*) 'set key noautotitle'
write(10,*) 'plot "1.txt" if (x(1) > 0 ) {with line 7} else { with line lt 3 } '
write(10,*) 'pause -1 "Hit return to continue"'
close(10) 当然,我有最多222.txt的1.txt,但是我只是在这里放了一个,因为它是重复的过程。
但是我没有任何阴谋,我的错误是什么?
发布于 2020-02-07 17:58:55
由于没有定义函数x(),所以还不清楚x(1) > 0究竟是什么意思。假设x(1)的意思是data value in column 1,那么
write(10,*) 'plot "1.txt" if (x(1) > 0 ) {with line 7} else { with line lt 3 } '正确的语法是
write(10,*) 'plot "1.txt" using 1:2:($1>0 ? 7 : 3) with lines linecolor variable'https://stackoverflow.com/questions/60111381
复制相似问题