引用GNUPLOT 6.0。如果数据文件不是在一行中构造的(典型的直方图),而是为3x3数组:
10.12172.7
20.11183.8
30.7555.4
使用循环:
gnuplot -p << EOF
set terminal png
set term pngcairo dashed
set title "Title" font ",15"
set ylabel "y" font ",15"
set xlabel "x" font ",15"
set style fill solid 1.0
filename2(n) = sprintf("data%03.0f.dat", n)
outfile (n) = sprintf("data%03.0f.png", n)
set boxwidth 1.0
set style fill solid 1.0
set tics font ", 16"
do for [N=15:15] {
set output outfile(N)
infile = filename2(N)
array scale[4]
scale[1] = 'r/r_0: 80 - 100%'
scale[2] = ' 50 - 80%'
scale[3] = ' 30 - 50%'
scale[4] = ' 10 - 30%'
plot for [i=1:3] filename2 (N) u(i): (column(3)):xtic(3) w boxes lc i notitle,\
for [i=1:3] keyentry w boxes lc i title scale[i] at graph 0.22, graph (0.99-0.045*i)
}
EOF
问题是我需要u(i)循环才能更改直方图颜色 “盒子lc i”,但它覆盖了直方图,剩下相同的值。或者我可以使用u(第(3)列):XTIC(3),但随后我松开颜色:
,让我们尝试一下,也许我现在知道了。
lc var
。检查help colorspec
顶的标签我建议强迫Y范围从0开始,即
set yrange [0:]
,否则可能会对酒吧的绝对/相对高度有错误的印象,除非您想带领某人相信其他东西。
与您没有可用的列数据
keyentry
(检查
every
SO,在最后一个绘图命令中,您实际上什么也没绘制,但是将字符串从第2列获取到传奇
标题:
help every
实际上,带有多余的传说...