Reputation: 1159
Currently, I am trying to stretch out the x-axis of a plot to search for things like seasonality, etc. Meaning, I would possibly like my x-axis to be 6 times or so longer than my y-axis, while keeping the ticks and data the same. An example:
x <- rnorm(20)^2 * 1000000
plot(x)
Is there a way to make the x-axis above much longer than the y-axis? Thanks!
Upvotes: 0
Views: 3138
Reputation: 4921
The commands below are writing it to a .png file with different width. The files fig1.png and fig2.png are saved to your home directory.
png("fig1.png", width = 400, height = 300)
x <- rnorm(20)^2 * 1000000
plot(x)
dev.off()
png("fig2.png", width = 600, height = 300)
x <- rnorm(20)^2 * 1000000 #or leave this out if you want the same data x
plot(x)
dev.off()
Upvotes: 1