all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* question about R graphics and latex export
@ 2011-02-17 13:52 Andreas Leha
  0 siblings, 0 replies; only message in thread
From: Andreas Leha @ 2011-02-17 13:52 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-17 13:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 13:52 question about R graphics and latex export Andreas Leha

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.