title: Gnuplot, Multiplot: Mix normal and parametric plot with a single legend box?
body: <p>I create overlapping graphs in Gnuplot, because I mix normal and parametric plots (and also pm3d maps and parametric surfaces). This works fine mostly, except for one thing: If both plots have a title, the legends usually overlaps. A typical example looks like this:</p>
  
  <pre><code>#legends.gp
  set term pngcairo enhanced color linewidth 1.5  dashed dashlength 1.4 rounded
  set output "legends.png"
  
  set title "legends test"
  
  set multiplot
  
  # make a box around the legend
  set key box
  
  set border 15 lw 1
  
  # fix the margins, this is important to ensure alignment of the plots.
  set lmargin at screen 0.15
  set rmargin at screen 0.98
  set tmargin at screen 0.90
  set bmargin at screen 0.15
  
  set xlabel "x"
  set ylabel "sin(x)"
  
  set xrange[0:2*pi]
  set yrange[-1:1]
  
  set grid x y
  
  # add single tic at 0.62
  set xtics add ("x0" 0.62)
  
  # main plot command
  plot sin(x) title "sinus"
  
  # turn everything off
  set format x ""   #numbers off
  set format y ""
  set xlabel ""     #label off
  set ylabel ""
  set border 0      #border off
  unset xtics       #tics off
  unset ytics
  unset grid        #grid off
  unset title       #title off
  
  #plot vertical line at 0.62
  set parametric
  plot 0.62,t ls 2 lw 2 title "parametric Line"
  unset parametric
  
  unset multiplot
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CpMYa.png" alt="Legends.png">
  My question is now, is there a simple, mostly automatic way to create a single legend for multiple plots?</p>
  
  <p>P.S. Sorry, I ended up making the example file more complex than it had to be by showing some more features, that are hopefully helpful for future readers.</p>