Graph gnuplot错误:“0”;Tic标签不作为字符串计算&引用;条形图

Graph gnuplot错误:“0”;Tic标签不作为字符串计算&引用;条形图,graph,gnuplot,Graph,Gnuplot,我正在开发Gnuplot 4.6补丁4。 我想用调色板创建条形图。我已经跟踪了,但出现了错误: Tic label does not evaluate as string! 是的,与我上面提到的参考不同的是xtics。我的图形在xtics中使用字符串 以下是我的示例数据: off 100.0 gpl 60.0 docs 99 vim 9.4 box 95 goo 60 ama 99.9 eba 99.98 我的绘图文件是: set term pos eps font 20 set st

我正在开发Gnuplot 4.6补丁4。 我想用调色板创建条形图。我已经跟踪了,但出现了错误:

Tic label does not evaluate as string!
是的,与我上面提到的参考不同的是xtics。我的图形在xtics中使用字符串

以下是我的示例数据:

off 100.0
gpl 60.0
docs    99
vim 9.4
box 95
goo 60
ama 99.9
eba 99.98
我的绘图文件是:

set term pos eps font 20
set style data histogram
set style histogram rowstacked
set boxwidth 0.75
set format y "%.0f%%"
set style fill solid border -1

set xtics font "Times-Roman, 15" rotate by 45 right
#set xtics center offset 0,-1
set ytics font "Times-Roman, 15" 

set palette defined ( 0 "#FFFFFF",\
                      1 "#FFCCCC",\
                      2 "#FF9999 ",\
                      3 "#FF6666",\
                      4 "#FF3333",\
                      5 "#FF0000",\
                      6 "#CC0000",\
                      7 "#C00000",\
                      8 "#B00000",\
                      9 "#990000",\
                      10 "#A00000")

set ylabel "Percentages"
#set xlabel "Services"
set yrange [70:100]
set output 'a2.eps'
plot 'a2.dat' \
    using ($2):xtic(1):($2<=10 ? 0 : $2<=20 ? 1 : 2) t '' with boxes palette
设置术语pos eps font 20
设置样式数据直方图
设置样式直方图行堆叠
将箱宽设置为0.75
设置格式y“%.0f%%”
设置样式填充实体边框-1
设置xtics字体“Times Roman,15”向右旋转45
#设置xtics中心偏移0,-1
设置ytics字体“Times Roman,15”
设置已定义的调色板(0“#FFFFFF”\
1“#FFCCCC”\
2“#FF9999”\
3“#FF6666”\
4“#FF3333”\
5“#FF0000”\
6“#CC0000”\
7“#C00000”\
8“#B00000”\
9 "#990000",\
10“#A00000”)
设置标签“百分比”
#设置xlabel“服务”
设置Y范围[70:100]
设置输出“a2.eps”
“a2.dat”地块\

使用($2):xtic(1):($2在
using
语句中,
xtic
标签部分应始终是
using
语句中的最后一个。此外,使用
打印样式时,必须指定x、y和颜色值:

plot 'a2.dat' \
    using 0:2:($2<=10 ? 0 : $2<=20 ? 1 : 2):xtic(1) t '' with boxes palette
绘图'a2.dat'\

使用0:2:($2非常有用。谢谢@Christoph.。是的,我忘了删除直方图,我以前使用直方图,现在我改为方框调色板。是否可以将调色板从数字改为字符串?