Encoding Gnuplot的波兰字母,UTF-8编码?

Encoding Gnuplot的波兰字母,UTF-8编码?,encoding,gnuplot,Encoding,Gnuplot,我有一个带有数据的CSV文件,我需要使用给定文件中的数据绘制直方图(实际上是条形图)。但是,轴X处的标签需要有波兰字母,例如ęƄƄśłł(或大写字母)。我已经用set encoding iso_8859_1设置了编码,但结果与我想要的不一样: 下面是我的gnuplot脚本: #!/usr/bin/gnuplot set encoding iso_8859_1 set datafile separator "\t" set termoption enhanced set terminal

我有一个带有数据的CSV文件,我需要使用给定文件中的数据绘制直方图(实际上是条形图)。但是,轴X处的标签需要有波兰字母,例如
ęƄƄśłł
(或大写字母)。我已经用
set encoding iso_8859_1
设置了编码,但结果与我想要的不一样:

下面是我的gnuplot脚本:

#!/usr/bin/gnuplot

set encoding iso_8859_1 
set datafile separator "\t"
set termoption enhanced

set terminal postscript eps size 5.5, 5.62 enhanced color font 'Verdana,20' linewidth 2
set output '2008.eps'
unset key 

set xtics nomirror rotate by -45 scale 0 font ",15"
set style data histogram
set boxwidth 0.2
set grid y
set yrange [        * : 20000]
set style fill solid border
plot '2008.csv' using 2:xticlabels(1) with boxes linecolor rgb "#00FF00", \
     ''          using 0:2:2 with labels center offset 0,1 notitle
和我的数据文件:

Województwo Suma
Dolnośląskie    4997    4997
Kujawsko-Pomorskie  10710   10710
Lubelskie   8978    8978
Lubuskie    4631    4631
Łódzkie 12609   12609

问题是:我需要做什么才能在X轴和绘图标题(此处不提供,但我想稍后添加)上有波兰语字母?多谢各位

您可能应该使用UTF-8。以下是我所做的:

set terminal epscairo enhanced color dashed rounded size 5.5, 5.62

set encoding utf8
set output '2008.eps'

unset key
set xtics nomirror rotate by -45 scale 0 font ",15"
set style data histogram
set boxwidth 0.2
set grid y
set yrange [*:20000]
set style fill solid border
plot '2008.csv' using 2:xticlabels(1) with boxes linecolor rgb "#00FF00", \
'' using 0:2:2 with labels center offset 0,1 notitle
(我从您的问题中复制了数据,该数据采用UTF-8格式,但不包含
选项卡
字符,因此我没有使用
设置数据文件分隔符“\t”

这给了我以下的结果


我使用的是
epscairo
终端,因为它使用
pango
库来呈现基于UTF-8的文本。

您确定数据文件的编码正确吗?@CodingLambdas:我想是的。在绘图之前,我使用了
iconv-t UTF-8 data.csv>2008.csv
,然后您可以将编码设置为
UTF-8
,而不是
ISO-..
。(虽然我不是gnuplot方面的专家,但我一生中任何时候都没有使用过它)@CodingLambdas:好的,我明白了。然而,根据你的建议,它并没有给我这样的东西:,这基本上仍然不是我所需要的。对不起。。。我想我没办法。正如我所说的,我与gnuplot没有任何关系。非常感谢您的帮助,这很有帮助!:)不客气。:-)如果您不知道,请查看和。这座城市或许也值得一看。