emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gerardo Moro <gerardomoro37@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Change both width and height of R plot in SRC block
Date: Thu, 30 Jun 2022 11:10:46 +0300	[thread overview]
Message-ID: <CAF4Fj9ix670qPK0C8u+CCuBdR1gtqGBarS+y5datvF2=v5jb1w@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1210 bytes --]

Hi,

I have been trying for over a year to change the output plot size when
using Orgmode SRC blocks with R. I have tried both using orgmode settings
and R settings.

I have a table from which I take some values.

#+name: cost
#+begin_src R :results output file graphics :file imag/cost.jpg :var
tab=cost
library(ggplot2)

ggplot(tab, aes(x = date, y = cost)) +
geom_line(color="darkgreen") + geom_point() +
scale_x_date(date_breaks = "1 day",
date_labels = "%b %d") +
theme(axis.text.x = element_text(angle = 90)) +
scale_y_continuous(breaks=seq(100,200,1)) +
ylim(100, 200)
#+end_src

The resulting plot (only showing the x axis) is squared, so the resulting X
axis is not legible at all:

#+RESULTS: cost
[image: image.png]

I have spent months to try to figure out how to have a non-square plot
showing in Orgmode, to no avail.

This presses me to stop using Emacs for graphing altogether.

I have head that this has more to do with R than with Emacs, but I have
tried all the R code advice out there.

I also have tried of course the #+attr_org: :width 600px :height:300px, but
it only considers the width, so I end up with another square.

If any of you has a solution,  much appreciated!

Best,
G. Moro

[-- Attachment #1.2: Type: text/html, Size: 1637 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 88665 bytes --]

             reply	other threads:[~2022-06-30  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30  8:10 Gerardo Moro [this message]
2022-06-30 12:46 ` Change both width and height of R plot in SRC block William Denton
2022-06-30 12:51 ` Ihor Radchenko
2022-06-30 18:30   ` Gerardo Moro
2022-06-30 18:51     ` Thomas S. Dye
2022-07-01 11:01       ` Jeremie Juste

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='CAF4Fj9ix670qPK0C8u+CCuBdR1gtqGBarS+y5datvF2=v5jb1w@mail.gmail.com' \
    --to=gerardomoro37@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).