emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Tyler Smith <tyler@plantarum.ca>
Cc: Emacs Org-Mode Help <emacs-orgmode@gnu.org>
Subject: Re: default units for graphics in R code blocks
Date: Mon, 30 Mar 2020 11:32:02 -0500	[thread overview]
Message-ID: <CA+M2ft-OBjgJk4Ju_xn9ZYB6pf1DTjRsOXwJ6cks=39sfKZgzQ@mail.gmail.com> (raw)
In-Reply-To: <87zhbx6e5c.fsf@plantarum.ca>

On Mon, Mar 30, 2020 at 10:45 AM Tyler Smith <tyler@plantarum.ca> 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	other threads:[~2020-03-30 16:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 15:44 default units for graphics in R code blocks Tyler Smith
2020-03-30 16:32 ` John Hendy [this message]
2020-03-30 16:58   ` Tyler Smith
2020-03-30 17:08     ` John Hendy
2020-03-30 17:25       ` Tyler Smith

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='CA+M2ft-OBjgJk4Ju_xn9ZYB6pf1DTjRsOXwJ6cks=39sfKZgzQ@mail.gmail.com' \
    --to=jw.hendy@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tyler@plantarum.ca \
    /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).