Skip to content
Prev 156043 / 398506 Next

Scaling X axis from -1 to 1

Gundala Viswanath wrote:
Hi Gundala,
If your data is named "mydata":

mynewdata<-rescale(mydata,c(-1,1))

This will linearly transform "mydata" into the range -1 to 1. You may 
also want to manually create the axis on the plot:

plot(mynewdata,axes=FALSE,...)
box()
axis(1)
axis(2,at=c(-1,0,1),labels=c("0","1000","2000"))

If you want the original values.

Jim

axis