Graphs in Rstudio notebooks generated using "Preview Notebook" take all the width of the HTML page. For example, for the default RStudio notebook:
I would like the plot to be smaller in the HTML page, not taking all the width.
I tried fig.width and fig.height, but they do not modify the space that the the plot occupies. For example for fig.width=1 and fig.height=1 the output looks like this:
This was a problem with the older version of RStudio. After updating RStudio to 1.3.1093, fig.width and fig.height allow you to make the plot smaller.
Related
I am trying to place side by side images in r markdown beamer using the code below.
```{r, out.width='.49\\linewidth', fig.cap='caption', fig.show='hold', fig.align='default'}
knitr::include_graphics(c('figures/yield.png', 'figures/boxplot_yield.png'))
However, the images somehow were vertically stacked, instead of horizontally. Please see the resulted plot below. Any ideas??
When I ran your code with my own pictures, they rendered side by side, you may need to make the pictures a smaller resolution and then your code should do what you want
I'm using RMarkdown on a new installation with RStudio. I'm finding that the inline preview is taking up the top two thirds of the text editor for my rmarkdown file. It's appearing, in addition to showing up inline below each paragraph, on top of the paragraphs.
It makes it hard to code or see any of the other work that I'm doing. The preview is fixed to the top of the screen and it stays there even when I scroll up and down in the document.
I can get rid of the inline preview by clicking clear all output.
I think this is probably a bug, but maybe not. I tried restarting RStudio and the issue persists.
If you go to Tools -> Global Options, a window will pop up. Select "R Markdown" on the left and you should see something like the below:
Half-way through, make sure "Show output inline for all R Markdown documents" is unchecked.
My plots are showing up with the titles way too zoomed it. They are printing like my available space is much smaller than it really is. It was working fine before. I've tried to reset it with dev.off() and par(mfrow=c(2,2)).
plot(mtcars$mpg)
Do you see how the dimensions are weird? I've also tried to clear the preivous plots.
This is the same plot printed on another computer with the viewerport set to about the same size.
I'm trying to create a flexdashboard with several tabs. One of them needs to include multiple graphs (~50). I produce the graphs under one single chunk within a loop (because numbers of graphs varies each time). What I get in the output is showing only some graphs without being able to scroll to see the rest of them. Scroll is totally deactivated but graphs are printed.
So far I've tried and didn't work to:
change the vertical_layout = scroll
adjust the row-height but graphs got shrunk (not readable)
download latest version of flexdashboard
include some CSS style (overflow-x: scrollbar;)
run the same in simple rmakrdown and works fine
when you put each graph in different chunk, scroll works properly but it doesn't solve my problem
Any ideas?
Thank you
If I make a default R presentation in Rstudio, everything looks okay, but the plot doesn't fill the whole slide.
This is the same whether in full screen or in the browser.
The documentation says "When the only content on a slide is an image, then the image will fill all available space on the slide". And it mentions that same goes for plots.
What am I missing here? What do I need to do to have the plot fill the whole slide?
I updated my RStudio to Version 0.99.903
Use out.width="100%" in your chunk options
{r, echo=FALSE, out.width="100%"}