in Education by
I made the following plot in my Rmarkdown file, and render it using Xaringan. --- title: "myTitle" output: xaringan::moon_reader: css: ["default", "kunoichi", "ninjutsu", "metropolis-fonts"] lib_dir: libs chakra: libs/remark-latest.min.js seal: false nature: countIncrementalSlides: false ratio: '16:9' --- # Two pretty gaussians ## and a few vertical lines ```{r, echo=FALSE, message=FALSE, warning=FALSE} library(cowplot) ggplot(data = data.frame(x = c(-3, 3)), aes(x)) + stat_function(fun = dnorm, n = 101, args = list(mean = 1, sd = 1)) + stat_function(fun = dnorm, n = 101, args = list(mean = -1, sd = 1)) + geom_vline(xintercept = 0, colour="black", linetype = "solid") + geom_vline(xintercept = c(-1.5,1.5), colour="black", linetype = "longdash") + ylab("Density") + xlab("\'Internal Signal\'") + scale_y_continuous(breaks = NULL) ``` This results in the following presentation. I just want to make the plot smaller, without the indirect step of having to save it as an image, then calling it and scaling it. Is there a way? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Using either out.width or out.height works, while maintaining the aspect ratio. Using them together allows you to alter the aspect ratio. Using either fig.width or fig.height, as suggested by @RichardTelford, works too, but doesn't maintain the aspect ratio. Nevertheless, you can use both together to get the correct aspect ratio. Bottom line: if I just wanted to scale down the image, I'd use either out.width or out.height. --- title: "myTitle" output: xaringan::moon_reader: css: ["default", "kunoichi", "ninjutsu", "metropolis-fonts"] lib_dir: libs chakra: libs/remark-latest.min.js seal: false nature: countIncrementalSlides: false ratio: '16:9' --- # Two pretty gaussians ## and a few vertical lines ```{r, echo=FALSE, message=FALSE, warning=FALSE, out.width = '200px'} library(cowplot) ggplot(data = data.frame(x = c(-3, 3)), aes(x)) + stat_function(fun = dnorm, n = 101, args = list(mean = 1, sd = 1)) + stat_function(fun = dnorm, n = 101, args = list(mean = -1, sd = 1)) + geom_vline(xintercept = 0, colour="black", linetype = "solid") + geom_vline(xintercept = c(-1.5,1.5), colour="black", linetype = "longdash") + ylab("Density") + xlab("\'Internal Signal\'") + scale_y_continuous(breaks = NULL) ```

Related questions

0 votes
    I'm graphing data with ggplot and animating it using gganimate. I have colors as my labels and when I add a ... changing the labels from color names to the number codes. df...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    I'm graphing data with ggplot and animating it using gganimate. I have colors as my labels and when I add a ... changing the labels from color names to the number codes. df...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    When I plot densities with ggplot, it seems to be very wrong around the limits. I see that geom_density ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    So I'm trying to make box and whisker plots for my weekly/monthly profit and loss for my sports betting picks for ... gotten me so far And following that here is my code exceldata...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Rendered font in IE7 width is bigger than in other borwsers ( Top image part is IE9, bottom part ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Can anyone see my syntax error? The jsTree just wouldn't render. plus a strange error in jquery 1 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Can anyone see my syntax error? The jsTree just wouldn't render. plus a strange error in jquery 1 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Rendered font in IE7 width is bigger than in other borwsers ( Top image part is IE9, bottom part ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Rendered font in IE7 width is bigger than in other borwsers ( Top image part is IE9, bottom part ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Is there a way to control which buttons to display in a Jquery Dialog? Scenario: Perhaps there might be ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    The actual chart of gvisBarChart is rendered by the web browser using _________ or VML. (a) JPEG (b) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    I am running the code and it works ggplot(data_df, aes(x= RR, y= PPW, col = year)) + ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I'm trying to plot a geom_rect(). Why do I receive an Error in FUN(X[[i]], ...) : ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I have a list of ggplots of simple ggplot line graphs based on a location. I created a list of ggplot ... (rnaturalearthdata) library(dplyr) library(ggthemes) #create line plot x...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    ________ modify a ggplot or theme object by adding on new components. (a) +.gg (b) -.gg (c) /.gg ... Data Analysis of R Programming Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
...