基于gnuplot的灰度直方图

基于gnuplot的灰度直方图,gnuplot,histogram,grayscale,Gnuplot,Histogram,Grayscale,我是gnuplot新手,我想为任意长度的数据集绘制一个三重直方图。 这是我的代码,但行设置调色板灰色似乎没有效果——所有内容仍在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:

我是gnuplot新手,我想为任意长度的数据集绘制一个三重直方图。 这是我的代码,但行
设置调色板灰色
似乎没有效果——所有内容仍在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

set palete
命令仅影响图像、pm3d曲面,如果与例如
linecolor palete
一起明确使用,则该命令会影响图像、pm3d曲面

终端选项
单色
对您也没有帮助,因为这会将所有线条的颜色设置为黑色,并使用不同的虚线图案

例如,可以重新定义线型的颜色:

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
请注意,
reset
不会恢复此线型更改。为此,必须重新启动gnuplot

或者,您也可以使用
设置终端pdf单色
设置样式填充图案