Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Sage worksheet demo of Gaston: Julia interface to gnuplot

Views: 305

testing Gaston with Julia in CoCalc in a Sage worksheet

Gaston provides an interface to gnuplot from the Julia language system.

Selected examples from the excellent Gaston Tutorial

There is a Jupyter notebook version of this worksheet.

%auto %default_mode julia
versioninfo()
Julia Version 0.6.2 Commit d386e40c17 (2017-12-13 18:08 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Xeon(R) CPU @ 2.20GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell) LAPACK: libopenblas64_ LIBM: libopenlibm LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)
Pkg.status()
1 required packages: - Gaston 0.7.4
Pkg.add("Gaston")
INFO: Package Gaston is already installed
# make sure gnuplot is installed run(`gnuplot --version`)
gnuplot 5.0 patchlevel 3
using Gaston
# 2D plot t = 0:0.01:1 plot(t, sin.(2Ï€*5*t))
1
# 3D plot x = y = -15:0.33:15 surf(x,y,(x,y)->sin.(sqrt.(x.*x+y.*y))./sqrt.(x.*x+y.*y),title="Sombrero",plotstyle="pm3d")
1
# image Z = [5 4 3 1 0; 2 2 0 0 1; 0 0 0 1 0; 0 1 2 4 3] imagesc(Z,title="Simple scaled image")
1
# histogram histogram(rand(1000),bins=15,norm=1,title="Histogram",yrange="[0:1.6]")
1