2014-10-09 91 views
1

我有兩個從相同的數據繪製熱圖和等值線圖。我想要以這種方式對他們進行繪製。我把它張貼在兩個地塊 headmapcontour。 我嘗試關注此頁面Splot (contour, view map) and plot on same graph但我無法意識到任何好處。 然後我添加我寫的兩個file.plt來獲得這兩個。Gnuplot:ovelap輪廓和熱圖

的熱圖的第一個:

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 

而且一個輪廓:

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 

有一些方法來overplot呢?我也附上elimnatedFinal.dat文件http://speedy.sh/tAhk3/elimnatedFinal.dat

非常感謝你們所有人!

回答

4

您需要的輪廓繪製的「表」(意爲另一個文件),這樣你有一組的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 

結果:

enter image description here