Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize ggplot graph in r notebook

I want to resize ggplot graph in Rnotebook.

enter image description here

It's too big it doesn't show anything like above. When I export it and increase the size about 4 times bigger, then it shows the details.

I've attempted the followings: set_plot_options fig.height, fig.width

to resize the graph but it didn't apply.

Please share if you have knowledge of how to resize plots.

like image 819
tmhs Avatar asked Nov 23 '16 01:11

tmhs


People also ask

Does Ggplot work in R markdown?

Therefore, ggplot2 graphics are often included in my R Markdown documents. Features of both packages are highly flexible and you CAN always get what you want !

How do I show plots in R markdown?

In RStudio, when you open a new RMarkdown file, in the editor pane, there is a cogwheel button / menu where you can choose "Chunk Output Inline". That should put the plots into the document.

What is the use of Ggplot in R?

ggplot2 is a plotting package that provides helpful commands to create complex plots from data in a data frame. It provides a more programmatic interface for specifying what variables to plot, how they are displayed, and general visual properties.


1 Answers

Your chunk should start with something like:

{r, fig.width = 12, fig.height = 12}

like image 165
Jacob Avatar answered Sep 29 '22 09:09

Jacob