1

I'm trying to add some guiding lines over a pm3d map using Gnuplot.

Below is the code I use to plot pm3d map (my pm3d map).

set terminal post eps enhanced color solid "Helvetica" 16
set encoding iso_8859_1
set hidden3d
set pm3d map
set view map
unset surface
set size square
splot "map.ene" with image
set xlabel "RC1 ({\305})"
set ylabel "RC2 ({\305})"
set cblabel "{/Symbol D}G (kcal/mol)" offset 1,0,0
set xrange ["1":"11"]
set yrange ["5.5":"9.5"]
set cbrange ["-3.1":"0.0"]
set xtics 1
set ytics 1
set cbtics 1
set mxtics 2
set mytics 5
unset key
set palette defined (-3.1 "red", -2.5 "yellow", -1.5 "green", -0.5 "blue", 0 "white")
unset colorbox
set output "map.eps"
replot

map.ene is in the format below:

1.000 5.500 0.00000 i

Now I want to add a vertical line (x=5.5) over the pm3d figure. I searched old posts and found similar questions already been asked by others. Seems there are two possible solutions:

1) prepare a separate data file for the line (x.dat, 5.5,y,0.0) then use command below to plot.

splot "map.ene" with pm3d, "x.dat" using 1:2:(0.0) with points linecolor rgb "black"

2) use "multiplot" facility in Gnuplot.

I tried both, neither worked. I've been playing this for a while but sill not sure how I should modify my original pm3d code to add guiding lines.

  • possible duplicate of : http://stackoverflow.com/questions/4499998/gnuplot-vertical-lines-at-specific-positions – bibi Jan 04 '16 at 18:59

1 Answers1

1

you can draw lines in gnuplot:

set arrow from first 5.5, graph 0 to first 5.5, graph 1 nohead

type help coordinates to better tune the above command.

bibi
  • 3,671
  • 5
  • 34
  • 50
  • Thanks for your suggestion! It did help. But what I still don't understand is "set arrow" only worked with "splot xxx with pm3d" while it did not work with my old codes posted above. Anyway, I got my figure now. Many thanks! – Shane Z. Yue Jan 15 '16 at 01:23
  • 1
    maybe your line in the file `x.dat` goes _under_ the pm3d (`z=0` seems common), try `"x.dat" using 1:2:(1.0)` – bibi Jan 15 '16 at 06:45
  • My problem solved using `front` to make the arrow line up on the graph. `set arrow from graph 0,0 to graph 1,1 nohead front linecolor "white" dashtype "-"` I was plotting a multiplot with pm3d. – Nick Dong Apr 26 '17 at 11:07