From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Kamm Subject: Re: Refresher on including R/ggplot2 output via latex/pdf? Date: Sun, 27 Oct 2019 21:32:37 -0700 Message-ID: <87sgndlcbe.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60873) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOwgP-0008K1-0A for emacs-orgmode@gnu.org; Mon, 28 Oct 2019 00:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOwgO-0007RV-3p for emacs-orgmode@gnu.org; Mon, 28 Oct 2019 00:31:08 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:36396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOwgN-0007PP-Sz for emacs-orgmode@gnu.org; Mon, 28 Oct 2019 00:31:08 -0400 Received: by mail-pf1-x436.google.com with SMTP id v19so6009884pfm.3 for ; Sun, 27 Oct 2019 21:31:07 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: John Hendy , emacs-orgmode Your code block looks fine to me. The typical R code block headers I use is as follows: :session :results output graphics :file path/to/file.png :exports results :eval never-export One thing I've noticed, if I have an existing graphics device open, it can mess up plots when executing an org-babel cell. Calling dev.off() a few times fixes this for me. Note I pretty much always use R blocks with the :session argument, things might be pretty different without it.