emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

save plot in python babel


From: Jeremie Juste
Subject: save plot in python babel
Date: Tue, 25 Aug 2020 14:05:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello,

I've barely use python with org-mode and I would need some help with the
python setup. I somehow have some trouble saving python plots. Is this the 
right way
to do it?


#+begin_src python :results output file link :file myfig1.pdf :session *Python*
  import matplotlib
  import numpy as np
  import matplotlib.pyplot as plt
  e_values = np.random.randn(100)
  plt.plot(e_values)
#+end_src


In R things seems to be smoother.

#+begin_src R :results output graphics  :file myfig1.pdf :session *R*
plot(1)
#+end_src

I tried to look around and noticed that the documentation regarding
python with org-mode is aging a bit and there are ob-* all over the
place. [1] ob-ipython does not seem to be maintained, [2] ein on top of 
ob-python

[1]: https://github.com/gregsexton/ob-ipython
[2]: https://github.com/millejoh/emacs-ipython-notebook


Any help will be appreciated. I'll be ready to improve the documentation of
org-babel python setup as soon as I'm more familiar with it myself.

Best regards,
Jeremie



reply via email to

[Prev in Thread] Current Thread [Next in Thread]