Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Specify output settings ...
set output "land_vs_latitude.svg"
set terminal svg size 750, 550 enhanced mouse jsdir "/js" rounded dashed
# Make functions ...
radius = 6371.009
radians(x) = pi * x / 180.0
f(x) = 2.0 * pi * radius * sin(radians(90.0 - x))
g(x,y) = (y / 360.0) * f(x)
# Specify plot settings ...
unset key
set grid
set title "Land -vs- Water (On Planet Earth)"
set xlabel "Latitude [deg]"
set xrange [-90:90]
set ylabel "Distance [km]"
set yrange [0:2.0 * pi * radius]
# Draw labels ...
set arrow from -40, 0 to -40, f(-40) nohead front lc rgb "red"
set label "Roaring Forties" at -45, 0.5 * f(-45) center rotate by 90 front textcolor rgb "red"
set arrow from -50, 0 to -50, f(-50) nohead front lc rgb "red"
set label "Furious Fifties" at -55, 0.5 * f(-55) center rotate by 90 front textcolor rgb "red"
set arrow from -60, 0 to -60, f(-60) nohead front lc rgb "red"
set label "Screaming Sixties" at -65, 0.5 * f(-65) center rotate by 90 front textcolor rgb "red"
set arrow from -70, 0 to -70, f(-70) nohead front lc rgb "red"
# Plot the data ...
set datafile separator ","
plot "land_vs_latitude.csv" every ::1 using 1:(0):(g($1, $2)) with filledcurves lc rgb "green", \
"land_vs_latitude.csv" every ::1 using 1:(g($1, $2)):(f($1)) with filledcurves lc rgb "blue"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.