user3754366
user3754366

Reputation: 551

Export a plot from R and increase size?

I am using R studio and exporting my plots with it. They look fine at smaller resolutions but when I make them larger for a word doc they become hard to read and don't look as 'crisp'.

Is there a better way to be exporting them that so when I make them larger they still look good ?

thanks

Upvotes: 2

Views: 2797

Answers (1)

Whitebeard
Whitebeard

Reputation: 6193

Here's a way to export a png file with different width/height

lm.SR <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)

library(grDevices)
png(file="myplot.png", width=1024, height=768)
plot(lm.SR, 1)
dev.off()

png(file="myplot2.png", width=2048, height=1536)
plot(lm.SR, 1)
dev.off()

Files will be stored in your current working directory

getwd()

Upvotes: 5

Related Questions