Message-ID: <48CE1BBD.9090209@bitwrit.com.au>
Date: 2008-09-15T08:24:29Z
From: Jim Lemon
Subject: Scaling X axis from -1 to 1
In-Reply-To: <73f827b50809140713l753afb87g76bed5ad108c743b@mail.gmail.com>
Gundala Viswanath wrote:
> Hi,
>
> I have a density plot in which the x axis
> ranged from 0 to 2000.
>
> How can I scale the data so that the x-axis
> is scaled in -1 to 1 form?
>
>
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