See https://datatofish.com/add-julia-to-jupyter/
Make sure you have julia installed. On Mac, I used:
brew install --cask julia
Then, make sure you install the kernel.
julia -e 'using Pkg; Pkg.add("IJulia")'
In the kernel section here, you have use a name consistent with your julia version.
(setq org-babel-default-header-args:jupyter-julia '((:async . "no")
(:session . "jupyter-julia")
(:kernel . "julia-1.8")
(:results . "value")
(:exports . "both")
(:eval . "never-export")))
(require 'jupyter)
(require 'ob-jupyter)
print("Hello World")
here is a fun ascii plot.
function mandelbrot(a)
z = 0
for i=1:50
z = z^2 + a
end
return z
end
for y=1.0:-0.05:-1.0
for x=-2.0:0.0315:0.5
abs(mandelbrot(complex(x, y))) < 2 ? print(".") : print(" ")
end
println()
end
These run asynchronously, be patient!
you have to install Plots if you don’t have it.
import Pkg; Pkg.add("Plots")
using Plots
x = 1:10; y = rand(10); # These are the plotting data
plot(x, y)
And, an entertaining function with emojis. This is a factorial function with recursion.
function 😎(🤓)
if 🤓 == 0
return 1
else
return 🤓 * 😎(🤓 - 1)
end
end
😎(3)