| Hosted by CoCalc | Download
Kernel: Julia

testing Gaston with Julia in CoCalc in a Jupyter notebook

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

This notebook shows a few examples from the excellent Gaston Tutorial

There is a Sage worksheet version of this demo notebook.

# Gaston requires Julia 0.6 or later 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)
# make sure gnuplot is installed run(`gnuplot --version`)
gnuplot 5.0 patchlevel 3
Pkg.status()
1 required packages: - Gaston 0.7.4
# if Gaston package is not available, add it. # Only need to do this once in a project. # Packages are stored in ~/.julia/ # Pkg.add("Gaston")
using Gaston

try different plotting modes with Gaston

  • 2D

  • 3D

  • image

  • histogram

# 2D plot t = 0:0.01:1 plot(t, sin.(2π*5*t))
Image in a Jupyter notebook
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")
Image in a Jupyter notebook
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")
Image in a Jupyter notebook
1
# histogram histogram(rand(1000),bins=15,norm=1,title="Histogram",yrange="[0:1.6]")
Image in a Jupyter notebook
1