emacs-orgmode
[Top][All Lists]
Advanced

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

ob-python.el: questions about output


From: R C
Subject: ob-python.el: questions about output
Date: Sun, 23 Feb 2020 11:43:41 -0500


The approach proposed for graphical output at https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html is

````
#+begin_src python :results file
import matplotlib, numpy
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(4,2))
x=numpy.linspace(-15,15)
plt.plot(numpy.sin(x)/x)
fig.tight_layout()
plt.savefig('images/python-matplot-fig.png')
return 'images/python-matplot-fig.png' # return filename to org-mode
#+end_src
````
and to use :results output for displaying stdout.
1. Is it possible to have both types of output displayed from a single src block to avoid having to duplicate the src block, using :exports results for one and :exports both for the other?
2. Is there an option to suppress export of the the last line of the src block which is specific to the ob-python implementation.

Thanks,
RC

reply via email to

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