我有一个包含两列的简单文件:
1 0.005467
2 0.005333
3 0.005467
4 0.005467
5 0.005600
6 0.005600
7 0.005467
8 0.005467
在第一列中我有x轴值,而在第二列上我有y轴值。我想绘制这个数据的数字。我为此写了一个gnuplot脚本:
#!/usr/bin/gnuplot
set xlabel "test"
set ylabel "value"
set grid ytics lt 0 lw 1 lc rgb "#bbbbbb"
set grid xtics lt 0 lw 1 lc rgb "#bbbbbb"
set autoscale
set terminal postscript portrait enhanced mono dashed lw 1 'Helvetica' 14
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "red"
set output 'out.eps'
plot 'data.txt' using 2:1 w points title "tests"
而且,输出:
但当然,作为gnuplot的新手,我有一些麻烦:
'data.txt' using 1:2
并将其替换为传奇?编辑(已解决的问题5)
plot 'data.txt' using 1:2 w points title "tests"
编辑(已解决的问题4)
set grid ytics lt 0 lw 1 lc rgb "#bbbbbb"
set grid xtics lt 0 lw 1 lc rgb "#bbbbbb"
答案 0 :(得分:2)
您应该在文档中阅读有关所有命令的内容!
几条评论:
如果您想要有色点,则不应使用mono
(即monochrome
)选项,而应使用color
。
您对线条样式的定义是正确的,但为了使用它,您必须在绘图时使用linestyle 1
。否则使用linetype 1
。比较:
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "red"
plot x, 2*x linestyle 1
要查看终端的所有点,请使用test
命令:
set terminal postscript eps enhanced color dashed lw 1 'Helvetica' 14
set output 'test.eps'
test
set output
你知道,对于填充点,你必须使用pt 7
。
我确定,这些点显示的是正确的值。使用
set ytics add (0.005467)
看到这个。