emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* default units for graphics in R code blocks
@ 2020-03-30 15:44 Tyler Smith
  2020-03-30 16:32 ` John Hendy
  0 siblings, 1 reply; 5+ messages in thread
From: Tyler Smith @ 2020-03-30 15:44 UTC (permalink / raw)
  To: Emacs Org-Mode Help

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.

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.

Best,

Tyler



-- 
Tyler Smith
http://plantarum.ca

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default units for graphics in R code blocks
  2020-03-30 15:44 default units for graphics in R code blocks Tyler Smith
@ 2020-03-30 16:32 ` John Hendy
  2020-03-30 16:58   ` Tyler Smith
  0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2020-03-30 16:32 UTC (permalink / raw)
  To: Tyler Smith; +Cc: Emacs Org-Mode Help

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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default units for graphics in R code blocks
  2020-03-30 16:32 ` John Hendy
@ 2020-03-30 16:58   ` Tyler Smith
  2020-03-30 17:08     ` John Hendy
  0 siblings, 1 reply; 5+ messages in thread
From: Tyler Smith @ 2020-03-30 16:58 UTC (permalink / raw)
  To: John Hendy; +Cc: Emacs Org-Mode Help

John Hendy writes:

>
> 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)
> """
>
The article I was referring to is:

https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html

The tutorial you found suggests the corrections needed in the one I
found; I can do that now!

Tyler


> 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
>>


-- 
Tyler Smith
http://plantarum.ca

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default units for graphics in R code blocks
  2020-03-30 16:58   ` Tyler Smith
@ 2020-03-30 17:08     ` John Hendy
  2020-03-30 17:25       ` Tyler Smith
  0 siblings, 1 reply; 5+ messages in thread
From: John Hendy @ 2020-03-30 17:08 UTC (permalink / raw)
  To: Tyler Smith; +Cc: Emacs Org-Mode Help

Bummer, that does indeed read pretty straightforwardly about inches.
Sorry about that.

Thanks for your efforts. I find org documentation challenging at
times, and am still not clear on worg vs. org. I believe I've asked on
this list before why those pages exist, as this seems like it should
be in the org official docs vs. in a sort of tutorial site. It makes
it tough as you can't find certain header args in the org docs; you
have to kind of know what you're looking for, or at least that the
header arg is *only* for, say, R, and not for anything else.

Anyway, thanks for contributing!

Best,
John

On Mon, Mar 30, 2020 at 11:58 AM Tyler Smith <tyler@plantarum.ca> wrote:
>
> John Hendy writes:
>
> >
> > 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)
> > """
> >
> The article I was referring to is:
>
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>
> The tutorial you found suggests the corrections needed in the one I
> found; I can do that now!
>
> Tyler
>
>
> > 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
> >>
>
>
> --
> Tyler Smith
> http://plantarum.ca

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default units for graphics in R code blocks
  2020-03-30 17:08     ` John Hendy
@ 2020-03-30 17:25       ` Tyler Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Tyler Smith @ 2020-03-30 17:25 UTC (permalink / raw)
  To: John Hendy; +Cc: Emacs Org-Mode Help

Yes, org info is spread wide and thin, and it's hard to tell which
source is the most recent/accurate. I think it might be useful to
consolidate and delete as much as possible, but that's going to be a lot
of work.

The existence of a page called "Library of Babel",
https://orgmode.org/worg/library-of-babel.html that doesn't actually
refer to org-babel seems especially misleading!

In any case, I updated ob-doc-R with the correct info.

Best,

Tyler


John Hendy writes:

> Bummer, that does indeed read pretty straightforwardly about inches.
> Sorry about that.
>
> Thanks for your efforts. I find org documentation challenging at
> times, and am still not clear on worg vs. org. I believe I've asked on
> this list before why those pages exist, as this seems like it should
> be in the org official docs vs. in a sort of tutorial site. It makes
> it tough as you can't find certain header args in the org docs; you
> have to kind of know what you're looking for, or at least that the
> header arg is *only* for, say, R, and not for anything else.
>
> Anyway, thanks for contributing!
>
> Best,
> John
>
> On Mon, Mar 30, 2020 at 11:58 AM Tyler Smith <tyler@plantarum.ca> wrote:
>>
>> John Hendy writes:
>>
>> >
>> > 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)
>> > """
>> >
>> The article I was referring to is:
>>
>> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>>
>> The tutorial you found suggests the corrections needed in the one I
>> found; I can do that now!
>>
>> Tyler
>>
>>
>> > 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
>> >>
>>
>>
>> --
>> Tyler Smith
>> http://plantarum.ca


--
Tyler Smith
http://plantarum.ca

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-30 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 15:44 default units for graphics in R code blocks Tyler Smith
2020-03-30 16:32 ` John Hendy
2020-03-30 16:58   ` Tyler Smith
2020-03-30 17:08     ` John Hendy
2020-03-30 17:25       ` Tyler Smith

Code repositories for project(s) associated with this 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).