Draw a line in a pm3d map

2020-04-16 18:24发布

I have adensity map and I want to overplot on it a line.

I define the line as a 3d line with constant height and I thought that with this method I have the possibility to overplot them one to another but, unfortunately, I failed. I realized in fact that the density map routine in gnuplot take the points of the line too.

This is my script:

reset

#set terminal pngcairo size 800,500 enhanced font 'Verdana,14'
#set output "map.png"
set title 'Map'


m_star=1.054
m_1=0.0093866
m_3=0.0078635

fact1 = (m_star+m_1)**0.5
fact2 = (m_star+m_3)**0.5

set pm3d map interpolate 1,1
set xrange [50.22:52.27]
set yrange [30.29:31.17]

splot "file.txt" u (fact1)*(($1)**(-1.5)):(fact2)*(($2)**(-1.5)):6 notitle ,\
      "line.txt" notitle 

And here the two files: line and density map.

It is possible to overplot them, in gnuplot?

Thanks a lot for your help !

1条回答
神经病院院长
2楼-- · 2020-04-16 19:02

If you set pm3d, this style is used for all plots unless you explicitely specify a different plotting style. So you must use

splot "file.txt" u (fact1)*(($1)**(-1.5)):(fact2)*(($2)**(-1.5)):6 ,\
      "line.txt" with lines 

in order to plot line.txt as line:

enter image description here

查看更多
登录 后发表回答