【问题标题】:Gnuplot color gradientsGnuplot 颜色渐变
【发布时间】:2014-08-06 08:22:43
【问题描述】:

我需要在我的绘图中创建多个垂直渐变 - 总共四个,以明确方向(N、E、S、W)。

#set 0 to 45 degrees color
set obj 1 rectangle behind from screen 0.09,0.2 to screen 0.89,0.29
set palette model RGB defined ( 0 "white", 1 "red")  
set cbrange[0:1]
unset colorbox

我在这里遗漏了什么吗? 提前致谢

【问题讨论】:

    标签: colors gnuplot gradient


    【解决方案1】:

    您不能用渐变填充矩形。 palette 仅影响绘制的函数或数据集。您可以使用imagepm3d 绘图样式来执行此操作。

    一个例子:

    set samples 100
    set isosample 100,100
    set xrange [0:1]
    set yrange [0:1]
    set palette defined (0 "white", 1 "red")
    set autoscale cbfix
    unset colorbox
    unset key
    
    set multiplot layout 2,2   
    plot '++' using 1:2:1 with image
    plot '++' using 1:2:2 with image
    plot '++' using 1:2:(-$1) with image
    plot '++' using 1:2:(-$2) with image
    unset multiplot
    

    使用 pngcairo 终端和版本 4.6.5 的输出是:

    现在您必须找到一种方法将其与您拥有的其他地块结合起来。

    【讨论】:

    • 我正在使用 X11 终端 - 是否需要任何其他规格?上面的代码我看不到任何颜色 - 猜这与终端类型有关?
    • 目前我只能测试两者都可以工作的 wxt 和 windows 终端。我今晚可以检查 x11 终端。你是如何运行代码的?把reset放在前面,或者开始一个新的交互会话,也许你还有一些残留的设置。
    • 好的 - 我在 x11 终端中看到了颜色,所以你的代码示例可以正常工作..谢谢 - 我只需要根据我的目的对其进行修改..
    • 我很难将代码示例融入我的脚本中。
    • 你能解释一下吗? - 设置调色板定义(0“白色”,1“红色”)设置自动缩放 cbfix unset colorbox unset key ;使用 1:2:(-$2) 与图像绘制 '++'
    猜你喜欢
    • 1970-01-01
    • 2015-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-26
    • 2011-03-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多