Set the plot size inside a R markdown

I'm working on a R markdown.

My problem is: inside the markdown I have the following chunk of code:

plot_correlation(dataset)

which generates the following image:

but as you can see, the texts are overlapped.

In the other hand, if I run the same command on the console, and click the button: "Preview" for the plot generated on the right panel, so the image covers the entire screen, then I can read the text properly.

My question is: is it out there any way to make the generated image on the R markdown to be bigger? There is no problem if when the image gets embedded on the HTML it is small, but at least, I would like that when I drag drop the image out to another tab, I can read the text properly.

Thanks!

What happens if you try the options fig.height and fig.width?

In case you don't know, there are lots of options documented here:

2 Likes

R for Data Science also has some concise and experience-tested advice for handling figure sizing in R Markdown: https://r4ds.had.co.nz/graphics-for-communication.html#figure-sizing

2 Likes

thank you guys, you are awesome!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.