Skip to content

Plot help

2 messages · André Luis Neves, Jim Lemon

#
Dear all:


I was wondering how I modify the plot command below so that the y-axis
displays the numbers in a 4 by 4 scale.


It looks like the plot generated by the commands below shows the y-axis in
a 5 by 5 scale:


Values <- c(1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16)

Values

Log <- log2(Values)

Log

Index <- c(1:9)

Index

##2) Plot

plot (x= Index, y=Values, ylim= c(-16,16), pch= 19, col = "blue")

points (Log, pch = 19, col="green")


Thanks.


Andre
#
Hi Andre,
Try this:

plot(x= Index, y=Values, ylim= c(-16,16), pch= 19,
 col = "blue",yaxt="n")
points (Log, pch = 19, col="green")
axis(2,at=seq(-16,16,by=4))

Jim
On Thu, Mar 17, 2016 at 8:32 AM, Andr? Luis Neves <andrluis at ualberta.ca> wrote: