1

I am not sure if this is possible, but I was wondering if I could expand the parameters of a base R plot. I am aware you can change the resolution/sizing of the graphs when you go to save them, but this isn't what I want to do. I was wondering if there is a command to stretch out the x/y-axis without increasing the range. I attached a picture of the graph I produced, which I feel is quite cramped and small. Below is also my code, which I don't think is an issue but wanted to attach anyways just to be safe. I'd appreciate any help, thank you so much!

plot(O2water, -1*O2rate,xlim=c(19,21.25))
abline(v=20.1)

enter image description here

  • Please provide a reproducible example so others can help. [How to make a great R reproducible example?](http://stackoverflow.com/questions/5963269) – Tung Mar 17 '22 at 04:26
  • 2
    `?par` lists many things which might be a factor, including `"mar"`. These proportions certainly look non-default, you can do one of the following: (1) close then re-open the graphic window (if using Rterm); (2) programmatically close the device with `dev.off(#)` where `#` is what you find with `dev.list()`; or (3) reset the `mar` to its default with `par(mar=c(5,4,4,2)+0.1)`. – r2evans Mar 17 '22 at 04:31
  • 1
    The overall size is set when you open the device, and interactive devices allow resizing later. So use something like `dev.new(width=7, height=7)` to open a larger device (the units are in inches). As @r2evans said, you probably should also adjust the margins. – user2554330 Mar 17 '22 at 09:41
  • Thank you both so much! This fixed my problem. – Rachel Davitt Mar 17 '22 at 13:29
  • I'm suspecting the `par()$mfrow`, so also see this answer: https://stackoverflow.com/a/7536008/6574038 – jay.sf Apr 20 '22 at 19:39

0 Answers0