emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Add caption to babel-generated images
@ 2016-08-30  9:27 Florian Lindner
  2016-08-30 10:11 ` Nicolas Goaziou
  2016-08-30 11:04 ` Georgiy Tugai
  0 siblings, 2 replies; 7+ messages in thread
From: Florian Lindner @ 2016-08-30  9:27 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I have this code block:

#+BEGIN_SRC python :exports results :results file
  import matplotlib.pyplot as plt, numpy as np
  x = np.linspace(-2, 2, 1000)
  plt.plot(x, np.exp(-np.power(4*x, 2)), label="shape-parameter=4")
  for i in range(-4, 5): plt.axvline(1/6 * i, ymax = 0.1, ls = "-.", color="r")
  plt.grid()
  plt.savefig('rbf-gaussian-4.pdf')
  return "rbf-gaussian-4.pdf"
#+END_SRC

When exporting to latex it nicely compiles into \includegraphics[width=.9\linewidth]{rbf-gaussian-4.pdf}.

Now I want to have this \includegraphics in a figure environement including a label (to reference it) and a caption.

How can do this best?

I have found:
http://emacs.stackexchange.com/questions/12150/add-caption-to-an-image-generated-by-a-code-block

but it doesn't work for me.

Thanks,
Florian

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

end of thread, other threads:[~2016-08-30 12:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30  9:27 Add caption to babel-generated images Florian Lindner
2016-08-30 10:11 ` Nicolas Goaziou
2016-08-30 10:40   ` Florian Lindner
2016-08-30 11:04 ` Georgiy Tugai
2016-08-30 11:54   ` Florian Lindner
2016-08-30 12:02     ` Florian Lindner
2016-08-30 11:55   ` Nicolas Goaziou

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).