Re: [R] How to avoid ggplot clipping the x axis [damn, replaces previous Email]

2021-01-11 Thread Chris Evans
Perfect. Can't believe I failed to find that! Thanks, as ever, Rui - Original Message - > From: "Rui Barradas" > To: "Chris Evans" , R-help@r-project.org > Sent: Sunday, 10 January, 2021 18:10:16 > Subject: Re: [R] How to avoid ggplot clipping t

Re: [R] How to avoid ggplot clipping the x axis [damn, replaces previous Email]

2021-01-10 Thread Rui Barradas
Hello, You are almost there. With scale_x_continuous use argument limits. ggplot(dat = tibDat, aes(x = x, y = y)) + geom_point() + scale_x_continuous(breaks = 1:6, labels = 1:6, limits = c(1, 6)) And with xlim it's not a vector c(1, 6), it's each element on it

[R] How to avoid ggplot clipping the x axis [damn, replaces previous Email]

2021-01-10 Thread Chris Evans
[I must try to remember that swapping between Rstudio and my Emailer is a recipe for hitting ctrl-enter and posting prematurely: sorry!] I am sure I am doing something stupid but I can't see what. I am plotting data and want the x axis labels to reflect the theoretical range of the x variable

[R] How to avoid ggplot clipping the x axis

2021-01-10 Thread Chris Evans
I am sure I am doing something stupid but I can't see what. I am plotting data and want the x axis labels to reflect the theoretical range of the x variable which happens to be 1:6 but the observed values have range 2.6 to 5.9. I thought xlim(c(1,6)) should have got me that quite simply but it