我使用的是 gnuplot 版本 4.6 补丁级别 4。
在此链接中测试示例脚本时:http://people.duke.edu/~hpgavin/gnuplot.html
我尝试使用以下命令加载:
gnuplot
gnuplot> load 'testplotdata.p'
但是没有打开窗户。有人可以提供一些指导吗?
脚本和数据如下。
testplotdata.p
# Gnuplot script file for plotting data in file "force.dat"
# This file is called force.p
set autoscale # scale axes automatically
unset log # remove any log-scaling
unset label # remove any previous labels
set xtic auto # set xtics automatically
set ytic auto # set ytics automatically
set title "Force Deflection Data for a Beam and a Column"
set xlabel "Deflection (meters)"
set ylabel "Force (kN)"
set key at 0.01,100
set label "Yield Point" at 0.003,260
set arrow from 0.0028,250 to 0.003,280
set xr [0.0:0.022]
set yr [0:325]
plot "testplotdata.dat" using 1:2 title 'Column' with linespoints ,
"testplotdata.dat" using 1:3 title 'Beam' with points
测试图数据.dat
# Force-Deflection data for a beam and a bar
# Deflection Col-Force Beam-Force
0.000 0 0
0.001 104 51
0.002 202 101
0.003 298 148
0.0031 290 149
0.004 289 201
0.0041 291 209
0.005 310 250
0.010 311 260
0.020 280 240
它对我有用。我的 Ubuntu 12.04 上的 gnuplot 也是 4.6 版补丁级别 4。检查您是否具有终端类型 wxt。您可以通过在 gnuplot 中发出命令 set terminal
来检查输出是否包含 wxt。如果没有,请安装gnuplot-x11
软件包(对于 Debian 和 Ubuntu,软件包名称可能与其他 Linux 发行版不同。