Changing the plot size You can change the plot size by setting the option repr. plot. width and repr.
To increase the width of axes (both X-axis and Y-axis at the same time) using ggplot2 in R, we can use theme function with axis. line argument where we can set element_line argument to a larger value.
Using R in a jupyter notebook, first I set the plot size universally. Second, I would like to plot one single plot with a different size.
## load ggplot2 library library("ggplot2") ## set universal plot size: options(repr.plot.width=6, repr.plot.height=4) ## plot figure. This figure will be 6 X 4 ggplot(iris, aes(x = Sepal.Length, y= Sepal.Width)) + geom_point() ## plot another figure. This figure I would like to be 10X8 ggplot(iris, aes(x = Sepal.Length, y= Sepal.Width)) + geom_point() + HOW DO i CHANGE THE SIZE?
As you can see, I would like to change the second plot (and only the second plot) to be a 10X8. How do I do this?
Sorry for a potentially dumb question, as plot sizing is typically not an issue in Rstudio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With