Skip to content

Instantly share code, notes, and snippets.

@oioki

oioki/speed.plt Secret

Created October 28, 2018 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oioki/6c3bc2115216f7e20ef9fffb0116e5e6 to your computer and use it in GitHub Desktop.
Save oioki/6c3bc2115216f7e20ef9fffb0116e5e6 to your computer and use it in GitHub Desktop.
Gnuplot altitude/groundSpeed graph
#!/usr/bin/gnuplot
set terminal png font './LiberationSans-Regular.ttf' 15 size 1600,900
set grid
set xlabel ''
set format x ''
set ylabel 'Altitude, m' tc lt 1
set ytics 1000 nomirror tc lt 1
set y2label 'Ground speed, km/h' tc lt 2
set y2tics 50 nomirror tc lt 2
set datafile separator ','
feet_to_meters(x) = x * 0.3048
knots_to_kmh(x) = x * 1.852
set output 'speed.png'
plot 'data.csv' using (feet_to_meters($1)) with lines lw 2 axes x1y1 notitle, \
'data.csv' using (knots_to_kmh($2)) with lines lw 2 axes x1y2 notitle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment