【问题标题】:Predefined point types in gnuplotgnuplot 中的预定义点类型
【发布时间】:2014-07-17 09:51:11
【问题描述】:

如何在 Gnuplot 中设置预定义的点样式?由于我是色盲,而且我真的不喜欢 Gnuplot 的标准颜色(颜色 3、4 和 5 对我来说是蓝色、蓝色和蓝色),我在我的主目录中的 .gnuplot 文件中列出了一些更友好的颜色。这个文件看起来像这样

set style line 1 lt 5 lw 5 lc rgb "red"
set style line 2 lt 6 lw 5 lc rgb "blue"
set style line 3 lt 2 lw 5 lc rgb "olive"
set style line 4 lt 3 lw 5 lc rgb "salmon"
set style line 5 lt 4 lw 5 lc rgb "black"
...

但是当我想绘制数据点时,它使用相同的原始 Gnuplot 颜色。有没有办法以与这些线相同的方式定义点?例如,第一个点类型是黑框,第二个是红色三角形等

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    对于这样的文件,您必须使用

    明确指定相应的线条样式
    load 'mycolors.gp'
    plot x linestyle 1, 2*x linestyle 2
    

    或者你使用set style increment user,它应该自动使用线型而不是线型:

    load 'mycolors.gp'
    set style increment user
    plot x, 2*x
    

    但请注意,不推荐使用 set style increment user

    在您的情况下,最好的选择是直接重新定义线型:

    set linetype 1 lt 5 lw 5 lc rgb "red"
    set linetype 2 lt 6 lw 5 lc rgb "blue"
    set linetype 3 lt 2 lw 5 lc rgb "olive"
    
    plot x, 2*x, 3*x
    

    附注:您必须记住set linetype 不受reset 的影响。

    您可能还想尝试使用 gnuplot 二进制文件附带的文件 share/colors_default.gpshare/colors_podo.gp 中定义的颜色(请参阅 Gnuplot line types 上的最后一张图片以了解它们的外观)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-19
      • 2019-08-17
      • 1970-01-01
      相关资源
      最近更新 更多