emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: default units for graphics in R code blocks


From: John Hendy
Subject: Re: default units for graphics in R code blocks
Date: Mon, 30 Mar 2020 11:32:02 -0500

On Mon, Mar 30, 2020 at 10:45 AM Tyler Smith <address@hidden> 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
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]