Hi all!
I wanted to embed some Julia code in some notes I’m taking, thus creating a notebook-like document. I am using Emacs with Org-mode, so I went for Org babel. I followed the instructions on Worg, but I still have some problems. I collect them all here, if you think it’s better to open a topic for each one I can do it of course, and I apologize. Anyway:
- Simple blocks like
#+begin_src julia :results output
4
#+end_src
actually are good. However, if I change the result type to
#+begin_src julia :results value
4+4
#+end_src
the execution is way slower, taking roughly 8 seconds and quite a lot of CPU time (even if the result is still produced and correct). Why?
- How can I produce graphs and pictures? Having
#+begin_src julia :results output
using Plots;
t = 0:0.01:4;
f₀ = 1; #Hz
Fₛ = 2;
Tₛ = 1/Fₛ;
CTsignal = sin.(2π * f₀ * t);
n = 0:Tₛ:4;
DTsignal = sin.(2π * f₀ * t);
graph = plot(t, CTsignal);
graph = scatter!(n, DTsignal);
gui(graph);
#+end_src
briefly produces the picture, but then it closes automatically. Can I keep the graph on screen?
-
Starting time is quite slow if I use external packages, like in the previous example where I used
using Plots;
. In my usual Julia workflow I have a sysimage to speed up this time. Can I do the same in Org mode? -
Even if I end an instruction with a semicolon, the value of the expression is always printed. This is strange: can I stop it? Moreover, if I process a long array, all of it is printed in the document (possibly thousands of values!), whereas in the usual Julia REPL it’s condensed with a vertical ellipsis (
⋮
). Can I do the same in Org?
Thanks!