Micah P. Dombrowski / Jul 12 2020
Gnuplot Example
Gnuplot From Bash
Install gnuplot.
apt-get -qq updateapt-get install gnuplot gnuplot-nox27.3s
Bash in Python
Upload Cavendish example data. Data can also be downloaded.
Create a gnuplot script file, and run it. You can also upload a script file, however this will make it a bit more complicated to use uploaded data files.
echo 'set terminal svgset output "/results/out.svgset title "Cavendish Data"set xlabel "Time (s)"set ylabel "Angle (mrad)"set gridplot _ with lines title "Cavendish"' > gnu.scriptgnuplot gnu.script0.9s
Bash in Python
Julia Interface
apt-get -qq updateapt-get install gnuplot gnuplot-nox18.2s
Bash in Julia
]add Gnuplot; precompile103.5s
Julia
using Gnuplotx = -2pi:0.1:2piapprox = fill(0., length(x)); tit="Polynomial approximation of sin(x)" key="opaque" linetypes(:Blues_4) :- "set encoding utf8" raw"""set xtics ('-π' -pi, '-π/2' -pi/2, 0, 'π/2' pi/2, 'π' pi)""" :- xr=3.8.*[-1, 1] yr=[-1.5,1.5] "set grid front" :- x sin.(x) approx .+= x "w filledcurve t 'n=0' lt 1" :- x sin.(x) approx .+= -x.^3/6 "w filledcurve t 'n=1' lt 2" :- x sin.(x) approx .+= x.^5/120 "w filledcurve t 'n=2' lt 3" :- x sin.(x) approx .+= -x.^7/5040 "w filledcurve t 'n=3' lt 4" :- x sin.(x) "w l t 'sin(x)' lw 2 lc rgb 'black'"save(term="svg size 640,480",output="/results/out.svg")60.3s
Julia