Gnuplot:如何设置pm3d地图透明?

Gnuplot:如何设置pm3d地图透明?,gnuplot,Gnuplot,我有一个非常简单的问题:我想知道如何在Gnuplot(gnuplotversion5.2)中使等高线图(pm3d地图)透明 我可以想办法画出透明的曲线或填充的曲线, (如本网站-) 但不是等高线图 我试图做的是,覆盖图像和等高线图,并希望使等高线透明 谢谢你的帮助 添加: 当我试着去做 set style fill transparent solid 0.5 轮廓区域变为灰色。。为什么会这样 有一个全局样式设置,它影响gnuplot中的所有填充对象,包括构成pm3d曲面的四边形。要设置50%

我有一个非常简单的问题:我想知道如何在Gnuplot(gnuplotversion5.2)中使等高线图(pm3d地图)透明

我可以想办法画出透明的曲线或填充的曲线, (如本网站-) 但不是等高线图

我试图做的是,覆盖图像和等高线图,并希望使等高线透明

谢谢你的帮助

添加: 当我试着去做

set style fill transparent solid 0.5
轮廓区域变为灰色。。为什么会这样


有一个全局样式设置,它影响gnuplot中的所有填充对象,包括构成pm3d曲面的四边形。要设置50%的透明度,请执行以下操作:

set style fill transparent solid 0.5
这仅适用于区域填充,但不适用于边。如果希望曲面整体透明,最好不要绘制边:

set pm3d noborder
注:我不确定“等高线图”如何适用于此。等高线是另一回事。也可以将它们设置为透明,但这不会影响pm3d曲面本身

这是在将填充样式设置为透明之前和之后绘制为“splot…with pm3d”的曲面。
据我所知,你的问题。。。您真的需要
splot
pm3d
? 也许以下也是一个可行的解决方案,只需
绘图。。。带有boxyError
。也许可以进一步优化

输入:“MapTest.png”

代码:

### map with transparent overlay
reset session
set term pngcairo size 700,700 font ",10"
set output "MapTransparent.png"
set size square
set margins 0,0,0,0
unset tics
set cbtics
unset key

# function "borrowed" from http://gnuplot-tricks.blogspot.com/2009/07/maps-contour-plots-with-labels.html
f(x,y)=(sin(1.3*x)*cos(.9*y)+cos(.8*x)*sin(1.9*y)+cos(y*.2*x))*3+15
set samples 51
set isosamples 51
set table $Data
    splot [0:600][0:600] f(x/60.,y/60.)
unset table
# create contour lines
set contour base
set cntrparam levels 10
unset surface
set table $Contour
    splot [0:600][0:600] f(x/60.,y/60.)
unset table

set xrange[0:600]
set yrange[0:600]
set palette rgbformulae 33,13,10

set style fill transparent solid 0.4 noborder
plot \
    "MapTest.png" binary filetype=png w rgbimage, \
    $Data u 1:2:(6):(6):3 with boxxyerror palette,\
    $Contour u 1:2:3 w l lt rgb "grey"

set output
### end of code
结果:

### map with transparent overlay
reset session
set term pngcairo size 700,700 font ",10"
set output "MapTransparent.png"
set size square
set margins 0,0,0,0
unset tics
set cbtics
unset key

# function "borrowed" from http://gnuplot-tricks.blogspot.com/2009/07/maps-contour-plots-with-labels.html
f(x,y)=(sin(1.3*x)*cos(.9*y)+cos(.8*x)*sin(1.9*y)+cos(y*.2*x))*3+15
set samples 51
set isosamples 51
set table $Data
    splot [0:600][0:600] f(x/60.,y/60.)
unset table
# create contour lines
set contour base
set cntrparam levels 10
unset surface
set table $Contour
    splot [0:600][0:600] f(x/60.,y/60.)
unset table

set xrange[0:600]
set yrange[0:600]
set palette rgbformulae 33,13,10

set style fill transparent solid 0.4 noborder
plot \
    "MapTest.png" binary filetype=png w rgbimage, \
    $Data u 1:2:(6):(6):3 with boxxyerror palette,\
    $Contour u 1:2:3 w l lt rgb "grey"

set output
### end of code

谢谢您的评论!但如果我们设置“透明实体0.5”,等高线图将变为灰色。。。。为什么?奇怪。您使用的终端类型是什么?再次感谢您的回答!是的,很奇怪。我能够在交互式命令行gnuplot中重现您的结果。但是我不能用我的gnuplot脚本复制。。。。在这个脚本中,我导出到png文件。好的,现在我解决了这个问题。。。当我从png改为jpeg(底层图像是jpeg)时,它成功了!(我仍然不明白发生了什么事)。这很奇怪,因为在png中创建等高线图并没有带来麻烦。