【问题标题】:Apply palette colors on set of functions在一组函数上应用调色板颜色
【发布时间】:2020-01-13 13:01:23
【问题描述】:

在 gnuplot 中,您可以非常简单地定义和绘制一组函数:

set terminal pngcairo
set output 'test.png'
unset key
f(a,x) = a*x
plot for [a=0:100:2] f(a,x)

但是我想根据a 的值使用调色板为集合着色

set palette defined ( 0 'red' , 100 'green' )

以下不起作用:

#random range from palette picked ( -> 0)
plot for [a=0:100:2] f(a,x) lc palette

#error no output
plot for [a=0:100:2] x:(f(a,x)):a lc palette

#colors not from palette
plot for [a=0:100:2] f(a,x) lc a

如何将调色板颜色应用于 gnuplot 中的一组函数?

linux上的gnuplot 5.2版

【问题讨论】:

    标签: colors gnuplot palette


    【解决方案1】:

    lc palette cb <value> 可以按值从调色板中选择颜色。值得注意的是,颜色框 (cb) 的范围需要与调色板范围相匹配:

    set terminal pngcairo size 350,300
    set output 'test.png'
    
    f(a,x)=a*x
    
    set palette defined ( 0 'red',  100 'green' )
    set cbrange [0:100]
    
    unset key
    set xrange [0:10]
    
    plot for [a=0:100:10] f(a,x) lc palette cb a lw 3
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-20
      • 1970-01-01
      • 2021-09-14
      • 1970-01-01
      • 1970-01-01
      • 2020-03-31
      • 2012-04-22
      • 1970-01-01
      相关资源
      最近更新 更多