all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Change both width and height of R plot in SRC block
@ 2022-06-30  8:10 Gerardo Moro
  2022-06-30 12:46 ` William Denton
  2022-06-30 12:51 ` Ihor Radchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Gerardo Moro @ 2022-06-30  8:10 UTC (permalink / raw)
  To: emacs-orgmode


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

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

end of thread, other threads:[~2022-07-01 11:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-30  8:10 Change both width and height of R plot in SRC block Gerardo Moro
2022-06-30 12:46 ` 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.