如何解决以文本列为X轴的Gnuplot绘图数据
我有一个文本文件,如下所示:
ls 10
cd 5
cut 12
awk 7
...
我想使用gnuplot将其绘制为文本列作为X轴:
plot 'data.txt' u 1:2
但是我得到这个错误:
warning: Skipping data file with no valid points
^
x range is invalid
感谢您的帮助
解决方法
$data << EOD
ls 10
cd 5
cut 12
awk 7
EOD
# this is all just plot layout stuff; customize to taste
unset border
set tics scale 0
set xzeroaxis
set title "x coord = line number"
# use line number for x coordinate,column 1 for tic label
plot $data using 0:2:xticlabel(1) with impulse
,
选中help xticlabels
。
并尝试以下方法:
reset session
$Data <<EOD
ls 10
cd 5
cut 12
awk 7
... 9
EOD
set boxwidth 0.7
set style fill solid 1.0
set yrange[0:]
plot $Data u 2:xtic(1) w boxes
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。