Possibly easier: plot(x, y, log = "x")
Cheers,
Michael
On Aug 30, 2012, at 5:47 AM, Rui Barradas wrote:
> Hello,
>
> The following is the general idea.
>
> x <-c(0.25,0.5,1,2,4,8,16,32)
> y <-c(1,1,1,1,0.9,0.8,0.6,0.2)
>
> plot(log(x),y,type="b", xaxt = "n")
> axis(1, at = log(x), labels = x
Hello,
The following is the general idea.
x <-c(0.25,0.5,1,2,4,8,16,32)
y <-c(1,1,1,1,0.9,0.8,0.6,0.2)
plot(log(x),y,type="b", xaxt = "n")
axis(1, at = log(x), labels = x)
If the x values are not so "neat", you can adjust the axis ticks and
labels using round/seq.
Hope this helps,
Rui Barrad
dear All
I am trying to plot the following with the x axis on the log scale, but I would
like the original x values to show up as labels:
x <-c(0.25,0.5,1,2,4,8,16,32)
y <-c(1,1,1,1,0.9,0.8,0.6,0.2)
plot(log(x),y,type="b")
here I would like the labels 0.25,0.5,1,2,4,8,16, and 32 to show on
3 matches
Mail list logo