emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mark Edgington <edgimar@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-babel generated images and +ATTR_LATEX
Date: Thu, 24 Oct 2013 02:30:08 +0000 (UTC)	[thread overview]
Message-ID: <loom.20131024T040235-701@post.gmane.org> (raw)
In-Reply-To: loom.20131023T224714-598@post.gmane.org

Hi Mike,

That does help -- when testing it, I found that the problem had more to do
with my header options than to do with the presence or absence of a #+NAME
line.  But still, with the header options I gave in my original example,
org-babel's behavior does seem strange (maybe buggy?) to me.  My working
code now looks like:

#+begin_src python :exports results :results file :eval no-export
    import matplotlib
    matplotlib.use('Agg')
    import matplotlib.pyplot as plt
    fig=plt.figure(figsize=(3,2))
    plt.plot([1,3,2])
    fig.tight_layout()
    figname = '/tmp/myfig.jpg'
    plt.savefig(figname)
    return(figname) # return this to org-mode
#+end_src

#+ATTR_LATEX: :float figure :placement [htb!] :width 0.38\textwidth 
#+RESULTS:

Anyhow, something that wasn't clear to me about your example is how you make
the filename which is generated via org-babel-temp-file available for use
within the code-block?

Regards,

Mark

  reply	other threads:[~2013-10-24  2:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 18:32 org-babel generated images and +ATTR_LATEX Mark Edgington
2013-10-23 20:50 ` Michael Gauland
2013-10-24  2:30   ` Mark Edgington [this message]
2013-10-24 20:14     ` Michael Gauland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20131024T040235-701@post.gmane.org \
    --to=edgimar@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).