Questions tagged [ggsave]

Use when asking a question related to saving a ggplot2 object. Part of ggplot2 package. ggsave is a convenient function for saving a plot. It defaults to saving the last plot that you displayed, using the size of the current graphics device. It also guesses the type of graphics device from the extension.

97 questions
0
votes
1 answer

why ggsave(..., dpi=300) did not change the graph psi to 300 but only increase the dimention of the graph

I am learning ggplot2 and try to use the ggsave() method to save my plot to a picture. I want my final graph to be 300 dpi, but no matter how I change the 'dpi=' value, what I finally got was only a graph with 72 Pixels/Inch, so what is the problem…
Jiang Xu
  • 91
  • 1
  • 10
0
votes
0 answers

Prevent generating Rplot.emf when a function using ggsave()

I have written a function to serve as a wrapper around ggsave() to save plots as an EMF (for use with PowerPoint). emf_save <- function(ggp) { filename <- glue::glue("{here()}", "/", …
user8701090
  • 48
  • 1
  • 5
0
votes
1 answer

ggsave creates an empty png file

I'm trying to save a plot that I create using the following code, but consistently get an empty .png file. I reuse some existing code to create the plot, and import tidyverse to access a number of functions, including ggsave(). Why doesn't ggsave()…
Thomas Philips
  • 935
  • 2
  • 11
  • 22
0
votes
1 answer

retreive Seurat object name in R during a for loop

I'm working on single cell rna-seq on Seurat and I'm trying to make a for() loop over Seurat objects to draw several heatmaps of average gene expression. for(i in c(seuratobject1, seuratobject2, seuratobject3)){ cluster.averages <-…
Sebrw
  • 47
  • 7
0
votes
0 answers

ggsave does not save gridlines in svg file

I'm trying to save a boxplot with ggplot in R with particular major and minor grid line sizes. If I save as a pdf or png I have no problem but when saving to svg (which I need to do in this case) the sizes of the lines are not saved. Please let me…
-1
votes
1 answer

Can you specify why ggsave function is not working?

I have run a meta-analysis in metafor and created a forest plot. I then tried to save this, using ggsave, as below: ggsave("../Desktop/ASPD_META_ANALYSIS_LAPTOP/CVR.png") But I get the error: Error in grDevices::dev.off() : QuartzBitmap_Output -…
-1
votes
1 answer

Create and save a plot for different groups using ggplot for loop from one .csv file

How do I create a loop that will produce and save 45 different line plots based on "Name" in the .csv file? I have one large .csv file that contains data for 45 different buildings by date. I need to create a line plot for each building that shows…
kwalk
  • 3
  • 2
1 2 3 4 5 6
7