Gnuplot,具有不同调色板的多个斑点

Gnuplot, multiple splots with different color palette

我有两个 3d 表面。是否可以为每个带有斑点的表面使用不同的调色板? 我使用的脚本和生成的图表如下:

set title "Thermal efficiency versus turbine inlet temperature and degree of superheating diagram"
    
set termopt enhanced 

set grid

set key top left

set xlabel "ΔT_{super} [^{o}C]"
set ylabel "T_{3} [^{o}C]"
set zlabel "n_{th} [-]"

#set datafile missing '0.000000000000000000e+00'
#set datafile missing '0.000000'

set hidden3d 
set pm3d 
set view 60,60

set palette rgb 7,5,15 #black-blue-red-yellow

splot "para_sub_dtsuper_iso_dtppreg_1.txt" using ():(-273.15):() title "Conventional ORC" with lines lt 1 lw 1.5,\
      "para_sub_dtsuper_iso_dtppreg_1.txt" using ():(-273.15):() title "Regenerative ORC" with lines lt 1 lw 1.5,\

pic_1

另一方面,我想知道是否可以生成如下图所示的网格颜色渐变表面:

pic_2

提前致谢。

这是 theozh 链接到的情节的修订版。它在同一张图中显示了两个表面,一个通过内置调色板机制使用颜色映射,另一个有效地显式地执行相同类型的颜色映射。 gnuplot 的开发版本已将此自动化,因此您可以通过为每个调色板分配一个名称来构造和使用多个调色板。

#
# Demonstrate construction and use of a separate palette
#
#       This method works 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 [0:5]
blues_min = 0
blues_max = 5

#
# 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]

F1(x,y) = sqrt(x*y)
F2(x,y) = (x*y)**(1./3)

set samples 41; set isosamples 41
set cbrange [0:5]; set xrange [0:5]; set yrange [0:5]
set palette cubehelix negative
unset colorbox

# Needed for proper occlusion of hidden surface
set pm3d depthorder
# Place a thin border around each facet of the surfaces
set pm3d  border lc "black" lw 0.5

set title "Top surface uses hand-constructed 'blues' palette via rgb variable\n".\
          "Bottom surface uses 'set palette cubehelix negative'"
set title offset 0,1

splot '++' using 1:2:(F1(,)):(blues(F1(,))) with pm3d lc rgb variable \
           title "F1(x,y) using 1:2:3:4 with pm3d lc rgb variable", \
      '++' using 1:2:(F2(,)) with pm3d \
           title "F2(x,y) using 1:2:3 with pm3d"

对于延迟回复,我深表歉意。这就是我要找的。非常感谢你们!