set output 'gaia_hip_delta_dist_d.ps' 
set term postscript color enhanced 'Helvetica,18'  
set grid 
unset key 
set ylabel 'Difference in distance (Gaia - Hipparcos) (pc) '  
set xlabel 'Gaia distance (pc) ' 
set title 'Comparison of Gaia and Hipparcos distance measurements '
plot [0:500][-50:50]     './gaia_hip_comp.dat' using ((1000.0/$4)):((1000.0/$4)-(1000.0/$9))       ps 0.1 lc rgbcolor "red"  t ''  ,     0 with lines lw 3 lc -1 t ''  ,    './gaia_hip_delta_dist.out' using ((1000.0/(0.5*($1+$2)))):($4)       with linespoints ps 2 pt 6 lw 3 lc rgbcolor "blue"  t ''  
set output 
quit 
