简体   繁体   English

gnuplot:ovelap轮廓和热图

[英]Gnuplot: ovelap contour and heat map

I have two plot a heatmap and a contour plot from the same data. 我有两个根据相同数据绘制的热图和轮廓图。 I want to over plot them in such a way. 我想以这样的方式来绘制它们。 I post it the two plots 我把这两个情节贴出来 头图 and 轮廓 . I try to follow this page Splot (contour, view map) and plot on same graph but I can not be able to realize anything good. 我尝试按照此页面进行绘制(轮廓图,视图图)并在同一张图上进行绘制,但我无法实现任何良好的效果。 Then I add the two file.plt I wrote to obtain this two. 然后添加两个我写的file.plt以获取这两个。

The first one for the heatmap: 热图的第一个:

clear
reset



FILE_IN_1="elimnatedFinal.dat" 
set terminal pngcairo size 500,500 enhanced font 'Verdana,10'
set output 'density.png'
set title "\n"
set label 1 "headmap" at graph 0.5,1.15 center
set xlabel ' Tp_2'
set ylabel ' Tp_3'
set cblabel 'amplitude'
set xrange [109:110.1]
set yrange [131.3:131.8]
set cbrange [90:180]
set palette defined ( 0 "green", 1 "blue", 2 "orange", 3 "red" )     

unset logscale cb
plot FILE_IN_1 u 1:2:3 w image notitle

And the one for the contour: 而轮廓的一个:

reset
clear
set terminal pngcairo size 500,500 enhanced font 'Verdana,10'
set output "gnuplot_contours.png"

set dgrid3d 20,20,20
set cntrparam levels incremental 120,10,180
set contour base
unset surface
set view 0,0

set xlabel ' Tp_2'
set ylabel ' Tp_3'
set format z ""
set title "contour"
splot "elimnatedFinal.dat" with lines notitle

There is some way to overplot them? 有一些方法可以对其进行过度绘制吗? I also attach the elimnatedFinal.dat file http://speedy.sh/tAhk3/elimnatedFinal.dat 我还附加了elimnatedFinal.dat文件http://speedy.sh/tAhk3/elimnatedFinal.dat

Thanks really a lot to all of you! 非常感谢大家!

You need to plot the contours to a "table" (meaning another file) so that you have a set of y(x) curves that can be plotted on top of the heap map: 您需要将轮廓绘制到“表”(意味着另一个文件)上,以便可以在堆图的顶部绘制一组y(x)曲线:

# Plot contours to table "contours.dat"
set dgrid3d 20,20,20
set contour base
set view 0,0
unset surface
set cntrparam levels incremental 120,10,180
set table "contours.dat"
splot "elimnatedFinal.dat" with lines notitle
unset table
reset

# Now plot heat map and contours on top
set xrange [109:110.1]
set yrange [131.3:131.8]
set cbrange [90:180]
set palette defined ( 0 "green", 1 "blue", 2 "orange", 3 "red" ) 
plot "elimnatedFinal.dat" u 1:2:3 w image not, "contours.dat" u 1:2 w l lc 0

Result: 结果:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM