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.
Related
Expanding the question by Jeremy K. in this question here Set ggsave() aspect ratio to the ratio that RStudio's "Zoom" button gives? specifically
I am using ggsave() to save plots from ggplot().
In R-Studio, clicking the "Zoom" button automatically resizes most of my plots to have quite aesthetic proportions, whereas when I try to manually specify the size and aspect ratios, I get plots that don't look as nice.
The answer to the original question and the answers to the similar question R: save figures in the zoomed window with command? both address screen size/resolution but nothing else. As the original question states the RStudio zoom has aesthetic proportions but using the screen width and height only sets the chart size and resolution. The titles, labels etc are all different (tiny in my case) in the saved image versus the original Rstudio zoomed image. Unfortunately using the 'inspect element' suggestion only gives the screen size and not any of the title and label sizes.
Is there a way that I can make ggsave (or any function) use the same aspect ratio or size ALL the same formats that R-Studio's "Zoom" button does?
I am encountering a weird issue where when I knit my markdown document to a pdf, some of the headers/figures are having a bunch of line breaks/spaces buffered above and below them (see image below for both code and knit document). I cannot figure out why this is occurring. I have checked the spaces above and below the headers and nearby chunks to make sure they are consistent, as I know this can sometimes cause similar issues, to no avail. There are some headers that are seemingly unaffected, and I tried to copy/paste those over the ones that are, and yet when doing so they also get the breaks added in that space.
When removing the code chunks for my plots, however, these mysterious spacings disappear.
Any suggestions would be greatly appreciated.
EDIT:
I believe I've solved the issue, and will leave this here in case anyone has similar issues in the future. I believe the buffers are being added around the headers under which the code chunks are placed because the image would otherwise be cutoff or not fit on the page in that location. Since markdown does not want the image to be cut off, it adds a space buffer to make sure it will fit on the page. You can work around this by either changing the size of the image or the location to make sure that it will fully fit on one page without being cut off.
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
I am looking for a way to modify the visual representation in Netlogo. My screen size is small, so when I want to capture a screenshot of my simulation result, the legends are not much readable. Even making the windows bigger does not affect the fonts. I wish there was also a way to make the curves in a plot thicker.
Any ideas?
Thanks,
I have create some ggplot2 bar plots which print fine to screen. When I print in PDF device, however, the chart and axis titles are too large - they sometimes extend past the left and right of the x-axis. None of these charts have any opts() set aside from title/axis-title - its all the defaults. What am I missing here? Is there a way to tell ggplot to auto-size this text so that the charts look good in PDF? Can I do this without explicitly setting opts()?
The best solution I can think of is to create a function to create a theme (like theme_bw()) and give it enough parameters so that its smart about sizing. Will keep this post open for a few days to see if there are any other clever ideas