emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ob-python.el: questions about output
@ 2020-02-23 16:43 R C
  2020-02-24  4:52 ` Jack Kamm
  0 siblings, 1 reply; 10+ messages in thread
From: R C @ 2020-02-23 16:43 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1312 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-27  9:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-23 16:43 ob-python.el: questions about output R C
2020-02-24  4:52 ` Jack Kamm
2020-02-24  4:53   ` Jack Kamm
2020-02-24  7:13   ` R C
2020-02-24 13:42     ` Fraga, Eric
2020-02-24 16:18       ` Jack Kamm
2020-02-24 16:49         ` Fraga, Eric
2020-02-24 16:17     ` Jack Kamm
2020-02-24 16:40       ` Fraga, Eric
2020-02-27  4:29       ` R C

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).