【问题标题】:grayscale histogram with gnuplot带有gnuplot的灰度直方图
【发布时间】:2013-11-13 17:29:37
【问题描述】:

我是 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

【问题讨论】:

    标签: gnuplot histogram grayscale


    【解决方案1】:

    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
    

    请注意,reset 不会还原此线型更改。为此,您必须重新启动 gnuplot。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-02
      • 2014-08-04
      • 1970-01-01
      • 1970-01-01
      • 2021-03-01
      • 1970-01-01
      • 2012-08-14
      相关资源
      最近更新 更多