带有gnuplot的灰度直方图

use*_*798 5 gnuplot histogram grayscale

我是gnuplot的新手,我想为任意长度的数据集绘制三重直方图.这是我的代码,但该行set palette gray似乎没有任何效果 - 一切仍然是RGB.我在这里错过了什么?

set terminal pdf enhanced
set output 'out.pdf'

set palette gray

set style data histogram
set style histogram cluster gap 1

set style fill solid 1
set auto x
set yrange [0:*]
plot 'in.dat' using 2:xtic(1) title col, \
        '' using 3:xtic(1) title col, \
        '' using 4:xtic(1) title col
Run Code Online (Sandbox Code Playgroud)

Chr*_*oph 5

set palette命令仅影响图像,pm3d表面以及如果明确使用例如linecolor palette.

终端选项monochrome也没有帮助,因为它将所有行的颜色设置为黑色并使用不同的虚线模式.

您可以重新定义线型的颜色:

set linetype 1 lc rgb 'black'
set linetype 2 lc rgb '#555555'
set linetype 3 lc rgb '#999999'
plot 'in.dat' u 2:xtic(1) t col, '' u 3 t col, '' u 4 t col
Run Code Online (Sandbox Code Playgroud)

请注意,这reset不会还原此行类型更改.为此,您必须重新启动gnuplot.

或者,您也可以使用set terminal pdf monochromeset style fill pattern.