Example Julia notebook¶
More info here: https://github.com/JuliaLang/IJulia.jl
Before you run this Notebook, you need to install IJulia locally:
julia -e 'using Pkg; Pkg.add("IJulia")'
In [1]:
using Pkg
In [2]:
Pkg.add("PyPlot")
Updating registry at `~/.julia/registries/General.toml` Resolving package versions... Installed Reexport ────────── v1.2.2 Installed FixedPointNumbers ─ v0.8.5 Installed PyPlot ──────────── v2.11.6 Installed LaTeXStrings ────── v1.4.0 Installed Statistics ──────── v1.11.1 Installed ColorTypes ──────── v0.12.1 Installed PyCall ──────────── v1.96.4 Installed Colors ──────────── v0.13.1 Installed MacroTools ──────── v0.5.16 Updating `~/.julia/environments/v1.11/Project.toml` [d330b81b] + PyPlot v2.11.6 Updating `~/.julia/environments/v1.11/Manifest.toml` [3da002f7] + ColorTypes v0.12.1 [5ae59095] + Colors v0.13.1 [53c48c17] + FixedPointNumbers v0.8.5 [b964fa9f] + LaTeXStrings v1.4.0 [1914dd2f] + MacroTools v0.5.16 [438e738f] + PyCall v1.96.4 [d330b81b] + PyPlot v2.11.6 [189a3867] + Reexport v1.2.2 [10745b16] + Statistics v1.11.1 [37e2e46d] + LinearAlgebra v1.11.0 [9e88b42a] + Serialization v1.11.0 [8dfed614] + Test v1.11.0 [e66e0078] + CompilerSupportLibraries_jll v1.1.1+0 [4536629a] + OpenBLAS_jll v0.3.27+1 [8e850b90] + libblastrampoline_jll v5.11.0+0 Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/9816a3826b0ebf49ab4926e2b18842ad8b5c8f04/build.log` Precompiling project... 484.8 ms ✓ Reexport 719.4 ms ✓ LaTeXStrings 716.7 ms ✓ Statistics 2781.5 ms ✓ MacroTools 2794.5 ms ✓ FixedPointNumbers 2093.8 ms ✓ ColorTypes 883.7 ms ✓ ColorTypes → StyledStringsExt 5886.2 ms ✓ Colors 11623.9 ms ✓ PyCall 3365.9 ms ✓ PyPlot 10 dependencies successfully precompiled in 20 seconds. 43 already precompiled.
In [3]:
import PyPlot
In [4]:
x = range(0, stop=2pi, length=200)
y = sin.(x)
PyPlot.plot(x, y);