From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Lindner Subject: Add caption to babel-generated images Date: Tue, 30 Aug 2016 11:27:01 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1befsb-0002CD-4O for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 06:02:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1befsU-0005wV-OI for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 06:02:52 -0400 Received: from [195.159.176.226] (port=43466 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1befsU-0005wK-Hm for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 06:02:46 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1befK2-0000qM-3K for emacs-orgmode@gnu.org; Tue, 30 Aug 2016 11:27:10 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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