[R] Change breaks x axis in plot

John Kane jrkrideau at inbox.com
Thu Nov 19 22:50:52 CET 2015


xx <- seq(1, 2, by = 0.1)
yy <- sample(1:20, 11)
plot(xx, yy, xaxt="n")
axis(1, at=1: 2, labels=letters[1:2])

may be what you want.

John Kane
Kingston ON Canada


> -----Original Message-----
> From: luysgarcia at gmail.com
> Sent: Thu, 19 Nov 2015 16:18:16 -0300
> To: r-help at r-project.org
> Subject: [R] Change breaks x axis in plot
> 
> I have the following graph:
>  my problem is the scale, I just need it to show the values for 1 and 2
> and
> remove the intermediate values (1.2,1.4,1.6,1.8). How could I do it? I'm,
> attaching the script code for the plot.
> 
> Thanks in advance
> 
> ###AV=mean values
> ##SD=Sd values
> 
> 
> plot(D ~ ferre$Cantidad, type="n",ylim=range(0:1.5))
> points(AV, pch = 16, cex = 1.5)
> arrows(x0 = AV$Group.1, y0 = AV$x, x1 = AV$Group.1, y1 =AV$x + SD$x,
> angle
> = 90)
> arrows(x0 = AV$Group.1, y0 = AV$x, x1 = AV$Group.1, y1 =AV$x - SD$x,
> angle
> = 90)
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!



More information about the R-help mailing list