0

What I am doing is producing a document using rmarkdown and kniting to a PDF. This seems generally a great thing and produces professional looking output. However, it is really frustrating to try and tweak the look of graphics. The preview looks fine in Rstudio, and then when the PDF is generated there is some issue with labels not fitting, etc.

Even though my data is relatively small, and I am only producing a dozen graphs, each knit of the document takes 5 minutes or so. That means a couple of tweaks of a graph takes 15 minutes!

Is there a way to set the default size of the RStudio plot window so this doesn't happen?

Any other tricks to speed up this process?

Thanks,

David

Phil
  • 7,287
  • 3
  • 36
  • 66
DavidF
  • 91
  • 5

1 Answers1

0

Running dev.new() will open a plot window that is to your specified sizes.

E.g. dev.new(width=5, height=4)

(from related question)

Else you could set the figure sizes for the chunk.

{r, fig.width=5, fig.height=4}  

(reference)

Dharman
  • 30,962
  • 25
  • 85
  • 135