r - Customizing Y axis values in plot -


i trying graph in r change it's y axis values. code:

plot(tree$num,tree$gra,      main="yslow grades",      xlab="har #",      ylab="grade",      xaxt="n") axis(1, @ = seq(1, 20, = 1), las=2) 

i have figured out how customize x axis, researching cannot find way change y axis too. instead of having numbers, want customize graph can letter grades in a,b,c , on. assume it's quick fix clueless , material seems lacking on subject.

to clarify, not want change y axis label or spacing, want able letters on y axis, regardless of data coming it.

just put yaxt = "n" , put new y labels axix(2, ....). example:

plot(1:20,1:20,      main="yslow grades",      xlab="har #",      ylab="grade",      xaxt="n",       yaxt = "n") axis(1, @ = seq(1, 20, = 1), las=2) axis(2, @ = seq(1, 20, = 1), label = rep(c("a", "b"), 10), las=2) 

enter image description here


Comments