【问题标题】:Forcing same palette on multiple pm3d plots in gnuplot在 gnuplot 中的多个 pm3d 图上强制使用相同的调色板
【发布时间】:2018-05-19 09:17:34
【问题描述】:

根据on splot pm3d 的重要信息,我想创建两个颜色范围相同的颜色/等高线图。

下面的代码创建了两个图。数据进入第一个数据集的方式有 z-data 2.0 到 5.5。第二个1.5到5.5。我希望两个图都使用并显示相同的色键比例,以便更好地进行比较。 (即 2 到 6)

我尝试使用 zrange 但它不起作用。

#- BASE ---------------------------------------------

reset
#set zrange [2:6]
set contour
unset surface
set cntrparam levels incr 2.0,0.5,8.0

set view map
set xrange [0:2184]
set yrange [0:1472]

set dgrid3d 100,100,4

set table "ap130_base_contour.txt"
splot 'ap130_base.dat' using 11:12:14
unset table

unset contour
set surface
set table "ap130_base_dgrid.txt"
splot 'ap130_base.dat' using 11:12:14
unset table

reset
set pm3d map
unset key
set palette defined (0 '#352a87', 1 '#0363e1',2 '#1485d4', 3 '#06a7c6', 4 '#38b99e', 5 '#92bf73', 6 '#d9ba56', 7 '#fcce2e', 8 '#f9fb0e')
set autoscale fix
set grid

set terminal png size 2184,1472 enhanced font "Helvetica,20"
set output 'ap130_base.png'

splot 'ap130_base_dgrid.txt' w pm3d, 'ap130_base_contour.txt' w l lc rgb "black"

set output
set  terminal X11




#- TSFF ---------------------------------------------

reset
#set zrange [2:6]
set contour
unset surface
set cntrparam levels incr 2.0,0.5,8.0

set view map
set xrange [0:2184]
set yrange [0:1472]

set dgrid3d 100,100,4

set table "ap130_tsff_contour.txt"
splot 'ap130_tsff.dat' using 11:12:14
unset table

unset contour
set surface
set table "ap130_tsff_dgrid.txt"
splot 'ap130_tsff.dat' using 11:12:14
unset table

reset
set pm3d map
unset key
set palette defined (0 '#352a87', 1 '#0363e1',2 '#1485d4', 3 '#06a7c6', 4 '#38b99e', 5 '#92bf73', 6 '#d9ba56', 7 '#fcce2e', 8 '#f9fb0e')
set autoscale fix
set grid

set terminal png size 2184,1472 enhanced font "Helvetica,20"
set output 'ap130_tsff.png'

splot 'ap130_tsff_dgrid.txt' w pm3d, 'ap130_tsff_contour.txt' w l lc rgb "black"

set output
set  terminal X11

注意第一个图中从 2.0 到 5.5 的色标

在从 1.5 到 5.5 的第二个图中

我希望两个图都有一个从 1 到 6 的色标。

感谢您的意见。 格特

【问题讨论】:

  • set cbrange [1:6]
  • 我想补充一点,建议的设置有效。要对此进行扩展,也可以向色标添加标签(设置 cblabel "Text")。很高兴看到 gnuplot 命令的系统性。

标签: gnuplot


【解决方案1】:

试试

set zrange[2:6]
set cbrange[2:6]

它应该可以解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-28
    • 2016-08-10
    • 1970-01-01
    • 2016-08-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多