我想将一些数据点(M_Coord_Plain.txt)绘制到2D轮廓投影上(由Contours.txt上的数据制作)。
我在这些帖子中找到了类似的答案:How to mark some points on 2D heat map in gnuplot?,Overlaying points onto a pm3d map? 但不幸的是,这些似乎不适用于我的情况。
首先我设置选项:
set pm3d explicit
unset surface # Switch off the surface
set view map # Set a bird eye (xy plane) view
set contour # Plot contour lines
set key outside
set cntrparam cubicspline # smooth out the lines
unset colorbox
然后我用splot命令绘图:
splot 'Contours.txt' using 1:2:3 notitle with pm3d,\
'M_Coord_Plain.txt' with points nocontour using 1:2:(0) pt 7
结果图只是轮廓2D投影,但没有任何点,没有错误。
答案 0 :(得分:0)
最后它起作用了,但是必须进行以下更改:
所以绘制所请求的图的命令是:
set pm3d explicit
set surface
set view map # Set a bird eye (xy plane) view
set contour # Plot contour lines
set key outside
set cntrparam cubicspline # Smooth out the lines
set cntrparam levels discrete 3.197,3.552 # Plot the selected contours
unset colorbox
set cbrange [0:7000] # Set the color range of contour values.
set palette model RGB defined ( 0 'white', 1 'black' )
set style line 1 lc rgb '#4169E1' pt 7 ps 2
splot 'Contours.txt' using 1:2:3 with pm3d notitle,\
'M_Coord_Plain.txt' using 1:2:(0) with points ls 1 notitle
结果图为this。