<snip>

#+begin_src R :results file :var basename="myplot"
  a <- 1:4
  pngfile <- sprintf("%s.png", basename)
  pdffile <- sprintf("%s.pdf", basename)
png(pngfile)
  plot(a)
  dev.off()
pdf(pdffile)
  plot(a)
  dev.off()
pngfile
#+end_src

I like this better, and I can use dev.copy here too. The issue is a
plot is rarely one line. Most of my plots are a half page of code
between the data set, legend, etc.


You could just make your complex plots functions, and then call your function in in one line. Or if you're using lattice or ggplot2, create objects representing the plot, and then plot them in one line.




_______________________________________________
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 via email to