emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dominique Dumont <domi.dumont@free.fr>
To: emacs-orgmode@gnu.org
Subject: Re: Refresher on including R/ggplot2 output via latex/pdf?
Date: Mon, 28 Oct 2019 09:21:08 +0100	[thread overview]
Message-ID: <3138050.Zb6PjB5n7X@ylum> (raw)
In-Reply-To: <CA+M2ft9CGxiCFYLmysVzPeYWLK_pci9znZtown3_GbavGc5Wkw@mail.gmail.com>

On Monday, 28 October 2019 05:16:00 CET John Hendy wrote:
> I just went to use what I think is how I used to include ggplot2
> results in PDF experts, but it's not working.
[...]
> My test file:
> -----
> * test
> 
> #+begin_src R :results output graphics :exports results :file foo.png
> library(ggplot2)
> 
> df <- data.frame(x=c(1, 2), y=c(2, 4))
> p <- ggplot(df, aes(x = x, y = y)) + geom_point()
> print(p)
> #+end_src

I had a similar issue to get plots in a revealjs export. Long story short, I 
solved the issue by adding these instructions at the end of the R script:

 grid::grid.newpage()
 grid::grid.draw(p)

Hope this helps

      parent reply	other threads:[~2019-10-28  8:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28  4:16 Refresher on including R/ggplot2 output via latex/pdf? John Hendy
2019-10-28  4:32 ` Jack Kamm
2019-10-28  4:40   ` John Hendy
2019-10-28  5:03     ` Jack Kamm
2019-10-28  5:13       ` John Hendy
2019-10-28  6:15         ` Jack Kamm
2019-10-28  7:43           ` John Hendy
2019-10-28 16:21             ` Berry, Charles
2019-10-28 16:30               ` John Hendy
2019-10-28 17:46                 ` Jack Kamm
2019-10-29 14:39                   ` John Hendy
2019-10-29 14:50                     ` Jack Kamm
2019-10-29 15:13                       ` John Hendy
2019-11-30 19:21                 ` Jack Kamm
2019-10-28  8:21 ` Dominique Dumont [this message]

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=3138050.Zb6PjB5n7X@ylum \
    --to=domi.dumont@free.fr \
    --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).