在gnuplot中绘制多个pm3d表面,每个表面都有自己的调色板

牛uga子

我基本上想要做的基本上是与该问题的解决方案Gnuplot 5.2 splot相同:在一个plot调用中有多个pm3d调色板,但它与pm3d一起使用。如果您阅读了对该答案的评论,则回答者说,如果他使用pm3d,则该解决方案将不起作用。另外,是否有可能以更简单的方式定义调色板,例如set palette defined ()

伊森

gnuplot的开发分支支持多个命名调色板。但是,此处显示的方法也适用于早期版本的gnuplot。它使用填充样式来提供颜色(而不是pm3d调色板),并显示如何定义填充颜色以使其模仿set palette defined()该演示仅构建一个映射,但是您可以定义多个映射,每个映射都有其自己的颜色数组和映射函数以使用它们。

该演示摘自开发分支中命名调色板的完整演示。如果您有兴趣,可以在这里找到完整的演示:5.5版名为palette demo

#
# Demonstrate construction and use of a separate palette
# Ethan A Merritt - May 2020
#
# Method 1:
#       The first method works also in 5.2 but requires "lc rgb variable"
#       rather than the more natural "fillcolor rgb variable".
#       "set pm3d interpolate" breaks the color mapping of this method

#
# This creates a palette equivalent to
#       set palette defined (0 "dark-blue", 1 "white")
#
array blues[256]
do for [i=1:256] {
    blues[i] = int( (0x7f + (i-1)/(255.) * 0xffff80) );
}

#
# This is the equivalent of
#       set cbrange [-1:1]
blues_min = -1
blues_max = 1

#
# This function maps z onto a palette color
#
blues(z) = (z <= blues_min) ? blues[1] \
         : (z >= blues_max) ? blues[256] \
         : blues[ floor(255. * (z-blues_min)/(blues_max-blues_min)) + 1]

foo(x,y) = sin(x*y)

set samples 41
set isosamples 41
unset colorbox
set cbrange [-1:1]
set xrange [0:5]; set urange [0:5]
set yrange [0:5]; set vrange [0:5]

set title "Use hand-constructed 'blues' palette via rgb variable"

splot '++' using 1:2:(foo($1,$2)):(blues(foo($1,$2))) with pm3d fillcolor rgb variable \
           title "pm3d using 1:2:3:4 with pm3d fillcolor rgb variable"

在此处输入图片说明

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

GNUPLOT:具有对数和调色板的对数颜色框

来自分类Dev

在gnuplot中绘制pm3d映射的python类比是什么?

来自分类Dev

在gnuplot中强制Z范围-pm3d

来自分类Dev

在gnuplot中的pm3d表面上绘制点

来自分类Dev

具有Picasso的ListView Android中的调色板

来自分类Dev

对象,调色板和pm3d

来自分类Dev

Perl Gnuplot-重新定义3d绘图调色板

来自分类Dev

Gnuplot 3D-绘制散点和它们之间的表面*和*线

来自分类Dev

带有来自不同数据文件的pm3d的GNUPLOT等高线

来自分类Dev

在gnuplot中管理调色板指示器

来自分类Dev

用显示一些标签的调色板绘制gnuplot

来自分类Dev

Gnuplot默认调色板

来自分类Dev

gnuplot:在多图模式下绘制单个调色板

来自分类Dev

pm3d的总和调色板

来自分类Dev

如何在Gnuplot中使用调色板绘制位置图?

来自分类Dev

绘制3D表面图

来自分类Dev

gnuplot的红色调色板

来自分类Dev

gnuplot:添加偏移量时绘制pm3d工件

来自分类Dev

从数据绘制3D表面

来自分类Dev

超文本能否与Gnuplot中的pm3d表面图一起使用?

来自分类Dev

gnuplot pm3d未绘制所有数据

来自分类Dev

gnuplot:更改自动调色板

来自分类Dev

Gnuplot 3D-绘制散点和它们之间的表面*和*线

来自分类Dev

pm3d的总和调色板

来自分类Dev

如何在Gnuplot中使用调色板绘制位置图?

来自分类Dev

如何用gnuplot(pm3d)中的特定数字除以数组的每个元素?

来自分类Dev

如何在gnuplot中绘制球体的表面?

来自分类Dev

在matlab中绘制3D云的表面

来自分类Dev

在 Gnuplot 中回收调色板