versioninfo()
Julia Version 1.9.3 Commit bed2cd540a1 (2023-08-24 14:43 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: macOS (x86_64-apple-darwin22.4.0) CPU: 8 × Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, skylake) Threads: 2 on 8 virtual cores
using Pkg
Pkg.activate(pwd())
Pkg.instantiate()
Pkg.status()
Activating project at `~/Dropbox/class/M1399.000200/2023/M1300_000200-2023fall/lectures/02-juliaintro`
Status `~/Dropbox/class/M1399.000200/2023/M1300_000200-2023fall/lectures/02-juliaintro/Project.toml` [31c24e10] Distributions v0.25.100 [f0f68f2c] PlotlyJS v0.18.10 [91a5bcdd] Plots v1.39.0 [274fc56d] PythonPlot v1.0.3
We demonstrate Plots.jl below:
using Plots, Random
Random.seed!(123) # set seed
x = cumsum(randn(50, 2), dims=1);
gr() # default backend
Plots.plot(x, title="Random walk", xlab="time")
using PythonPlot # WARNING: this installs a matplotlib on its own; it takes ~300MB
pythonplot() # set the backend to PythonPlot
Plots.plot(x, title="Random walk", xlab="time")
using PlotlyJS
plotlyjs() # set the backend to PlotlyJS
Plots.plot(x, title="Random walk", xlab="time")
gr()
@gif for i in 1:20 # animated GIF
Plots.plot(x -> sin(x) / (.2i), 0, i, xlim=(0, 20), ylim=(-.75, .75))
scatter!(x -> cos(x) * .01 * i, 0, i, m=1)
end;