0

I am trying to save a plot created with ggplot from R to paste on my report in Word, but I am having issue with the dimensions.

plot_2.2 <- ggplot(data = data_2.2_melted, aes(x=value, y=variable, shape = Gender)) +
  geom_point(size = 1.8, alpha = 0.5, col = "black")

#Change size of text and position of legend
plot_2.2_final <- plot_2.2 + theme(axis.text = element_text(size = 10, colour = "black")) + 
  theme(legend.position = "left", 
        axis.title.x=element_blank(),
        axis.title.y=element_blank()) +
  scale_shape_manual(values = c("M"= 17, "F" = 19))

I am trying

png(file="folder/saving_plot2.2.png",
    width=790, height=840)
plot_2.2_final
dev.off()

But the dimensions are too small. If I try bigger dimension, eg

    width=990, height=1140)
plot_2.2_final
dev.off()

I still get the dimensions of the first plot. It is like R is imposing size limits.

I have similar issues when I try to copy directly from R (i.e. Plot - Export - Copy to Clipboard) as I can get bigger plots. I also tried to save in PDF to get a bigger plot, but it is smaller.

Could anyone help? Thank you

FrAiello
  • 73
  • 1
  • 1
  • 7

0 Answers0