From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: default units for graphics in R code blocks Date: Mon, 30 Mar 2020 11:32:02 -0500 Message-ID: References: <87zhbx6e5c.fsf@plantarum.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50125) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIxKj-0005jD-3P for emacs-orgmode@gnu.org; Mon, 30 Mar 2020 12:32:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIxKh-0001qL-SE for emacs-orgmode@gnu.org; Mon, 30 Mar 2020 12:32:16 -0400 Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]:35424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIxKh-0001nY-M0 for emacs-orgmode@gnu.org; Mon, 30 Mar 2020 12:32:15 -0400 Received: by mail-vs1-xe29.google.com with SMTP id u11so11474257vsg.2 for ; Mon, 30 Mar 2020 09:32:15 -0700 (PDT) In-Reply-To: <87zhbx6e5c.fsf@plantarum.ca> 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Tyler Smith Cc: Emacs Org-Mode Help On Mon, Mar 30, 2020 at 10:45 AM Tyler Smith wrote: > > Hi, > > The worg documentation for R code indicates the default units for > graphics output is 'in', inches. However, when I try the following: > > #+begin_src R :results file graphics :file ca.jpg :width 8 :height 11 > plot(1:10) > #+end_src > > I get an error noting the margins are too large. If I change the width > and height arguments to 800, it works just fine, and the resulting image > is pretty small. When you examine the properties of this "pretty small" resulting image, is the size equal to 800 x 800px? > I can also get a working image by specifying units as in and res as 100. > > I conclude from this that the default units are actually pixels? Is that > correct? If so I can update the docs. I'd have to look deeper/test to confirm, but believe the units are according to the output device. I'm near certain, for example, that PDF output is in inches. I think png and jpg may both be px. It may not be consistent/universal is my point! Edit before sending: Best to cite exactly which article you're referring to. Trying to look myself, for example, found me this as the only worg hit from googling "worg R plotting": - https://orgmode.org/worg/org-tutorials/org-R/org-R.html """ Output options height:1000set height of graphical output in (pixels for png, jpeg, bmp, tiff; default 480) / (inches for pdf, ps; default 7) width:1000set width of graphical output in pixels (default 480 for png) """ It seems that aligns with my recollection, but may very well differ from the article you found. Thanks for any edits/corrections you make! Best regards, John > > Best, > > Tyler > > > > -- > Tyler Smith > http://plantarum.ca >