我一直在关注有关如何运行 gnuplot 的各种教程,并提出了这个脚本。到目前为止一切顺利,但是当我尝试更改偏移量时,xlabel
或者ylabel
我在终端中收到一条消息:
gnuplot> set xlabel "Applied Current [mA]" -0.3
^
line 0: ';' expected
我正在绞尽脑汁,所以我什至在互联网上测试了示例 xlabel 和 ylabel 并且出现了相同类型的错误
#!/bin/bash
gnuplot << TOEND
# Set the output file
set terminal postscript eps color enhanced
set output 'fp.eps'
unset key
set title "Voltage as a Function of Current"
set noborder
set xtics axis
set ytics axis
set format x "%2.0f"
set format y "%2.0f"
u(x)=m*x+b
fit u(x) "nfp.dat" using 1:2 via m,b
v(x)=m*x+b
fit v(x) "wfp.dat" using 1:2 via m,b
set xzeroaxis linestyle 2 lt 1 lc 0
set xlabel "Applied Current [mA]" -0.3
set yzeroaxis linestyle 2 lt 1 lc 0
set ylabel "Voltage [mV]"
set xrange [ -15.00 : 15.00 ]
set yrange [ -20.0 : 20.0 ]
plot 'nfp.dat' using 1:2, \
v(x), 'wfp.dat' using 1:2, \
'sfp.dat' using 1:2
TOEND
convert -density 100 fp.eps fp.png