Hi, I have data where two variables are measured such that X runs from 0 to 70 and Y runs from 0 to 100. I want to make a simple scatterplot of the observations.
The scatterplot should be dimensionalized, such that the x-axis (running from 0-70) is .7 the size of the y-axis (which runs from 0-100).
I use the following code
plot.new() plot(0, 0, asp = 1, xlim = c(0, 70), ylim = c(0, 100), xlab = "", ylab = "", type = "n")
I am surprised to see that this yields a graph as follows:
Two things are not how I expected it: 1) the x-axis and y-axis are NOT restricted to their xlim and ylim values. (Why is that?) and 2) the figure is almost square.
I can resize the figure manually, by manually resizing the R window or the Rstudio window before using the code, but that is not feasible, because I have a great many figures to draw, many with varying xlim and ylim sizes and these figures need to be inserted into preformatted reports later (which is why they need to fulfill these exact layout demands).
I have also tried using
dev.new(width = 7, height = 10)
but that didn't help either.
My question is:
1) how can I "force" the figure to be restriced to the exact xlim and ylim ranges passed to the function?
2) how to generate a figure with the exact relative dimensions (the x-axis being .7 times as wide as the length of the y-axis)