From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: question about R graphics and latex export
Date: Thu, 17 Feb 2011 14:52:45 +0100 [thread overview]
Message-ID: <4D5D282D.9010309@med.uni-goettingen.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1785 bytes --]
Hi all,
I usually produce tikz graphics in R which produce great results in
latex export (and I am able to handle them....).
Now I have some plots too big to handle with tikz, so I go for pdf.
I have a question (example below):
There is one piece of code to produce several plots according to some
(only one in the example) parameters. Now with pdf I have to produce a
different pdf file for each parameter (combination).
My question is: Can I use Org variable and #+call: constructs to do that?
Thanks in advance!
- Andreas
PS: This is my sample:
=============================
#+TITLE: Test Plots
* Test
** The plotting code
This code takes the parameter =sd=
#+srcname: plot_code
#+begin_src R :session :exports code :eval never :var sd
plot(x=rnorm(100, sd=sd),
y=rnorm(100, sd=sd))
#+end_src
** Set the parameter in =R= (working)
When setting the parameter in =R= I need an "indirect" code block:
#+srcname: plot_sd_1
#+begin_src R :session :noweb tangle :file plotone.pdf :exports
results :results graphics silent :width 8 :height 4
sd <- 1
<<plot_code>>
#+end_src
Now I can include this nicely in latex: See figure \ref{fig:test}
#+begin_src latex :noweb yes
\begin{figure}[htb!]
\centering
\includegraphics[width=5in]{<<plot_sd_1()>>}
\caption[Test]{Test 1}
\label{fig:test}
\end{figure}
#+end_src
** Set the parameter in Org (How to do)
The following does not work. Is this somehow possible? Would be
much nicer than setting the parameters in R.
# #+call: plot_code(sd=1) :session :file plotthree.pdf :exports results
:results graphics :width 8 :height 4
=============================
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 6432 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
reply other threads:[~2011-02-17 13:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4D5D282D.9010309@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.de \
--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).