117 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
4
votes
1
answer
137
views
Different title in ggsave PNG when looping over plots
Saving a ggplots as PNG within a loop gives me a wrong plot title for one of the plots.
See reprex below, output corresponds to what I see in RStudio plot pane.
But then, my saved PNG via ggsave() has ...
2
votes
1
answer
183
views
How to create page margins in a ggsave() pdf file
I am trying to print a series of ggplot graphs in a multipage PDF. Everything works fine except I can't figure out how to define the page margins. I want to produce 8.5x11 pages with 1" margins ...
3
votes
1
answer
181
views
Problems saving in 300 dpi using ggsave
I am having problems saving my plots in 300dpi.
I have used a similar code before but now it is saving them in 96pdi
Here is a sample code (doesn't matter what type of plot it save it at the same ...
1
vote
0
answers
52
views
ggplot2 & ggsave - Symbol doesn't save in png [duplicate]
I'm trying to make a panel in a plot that shows the R squared value of the correlation in another panel. When I create the plot, it shows up fine in RStudio, but when I save to PNG, the colon symbol ...
0
votes
0
answers
60
views
Why does R's 'ggsave' suppress 'message' behaviour?
I'm running an R script with several loops using RStudio on Posit Workbench. Some of the progress of the loops is tracked by e.g. message("Processing: ", current_iteration).
Annoyingly, when ...
2
votes
1
answer
382
views
R web::PieDonut displays pie-donut plot fine in RStudio, but saves to file without the inner pie
My goal is to create a pie-donut plot using webr PieDonut and save as a png or jpg. My issue is that the plot shows great with both pie and donut when displayed in r notebook, but once saved to file, ...
0
votes
1
answer
383
views
ggsave doesn't export well ggarrange plot
I want to export a ggarrange object as a .jpg or .tiff with dpi=300, using "mm" units, with a width of 107 mm.
Unfortunately, when using ggsave, I struggle to the desired output, every sizes ...
0
votes
0
answers
185
views
HPC and ggsave - unable to open connection to X11 display
I am running code on a HPC to generate plots using ggplot2. However, when attempting to save the plots with ggsave(), I encounter the following warnings:
Error in .External2(C_X11, paste0("png::&...
0
votes
1
answer
131
views
Saving plots in multiple columns using ggsave() cuts 2/3 of output [closed]
I created 200 * 3 plots (3 rows, 200 columns). I need to save them all in one pdf file on a single page. The code itself does not trigger any errors or warnings but the upper two graphs are being cut ...
2
votes
0
answers
222
views
R ggplot's linewidth is thicker than specified when writing to pdf, but not in print
My problem cosists of two parts:
Very thin lines (or very small symbols) in ggplot look different in the plot viewer or a png (left) than when I save them to pdf (right):
df = data.frame(Year = ...
2
votes
1
answer
61
views
How to skip ggsave when create plot failed or empty plot
In the code below, how can I skip
ggsave(paste0(single_color,"_plot.png"))
when the code
plot_data <- diamonds %>% filter(color== single_color) errors or plot_data is empty ?
library(...
0
votes
1
answer
66
views
Saving figure created using ggplot and grid.arrange to specific folder using ggsave and here [closed]
I am working from an R project and have files arranged in folders: Data, Script, Output_Files. I have created a figure using grid.arrange and ggplot and want to save it to the Output_Files folder ...
2
votes
0
answers
209
views
Issue Exporting Plots with different fonts in R using ggsave
I am trying to export plots with different font text in R using the ggplot2 package and the ggsave function. When I attempt to save the plot as an EPS file, the specified font is ignored.
I would like ...
0
votes
1
answer
95
views
Insert Dynamic Section Headers using ggsave() for ggplot2 objects without using markdown
I'm trying to see if I can generate a pdf using ggsave to have section headers in the resultant pdf. In this sample code below, I have two plots, plot_a and plot_b, saved in a list that will then be ...
1
vote
1
answer
995
views
ggsave is ignoring my specification for height and width
I am trying to save a ggplot graph for a publication with specific criteria. Whenever I go about saving the plot using ggsave setting the height, width, units and DPI I get an image that is always ...