change tick labels in sunflower plot in R -
say have following data
a <- c(1,1,1,2,2,3,3,4,4,4) b <- c("a","b","a","c","c","a","c","d","c","a") x <- data.frame(a,b) sunflowerplot(x$b ~ x$a, main = "sunflower plot", xlab = "type a", ylab = "type b", size = 0.25, cex.lab = 1.5, mgp = c(2.5,1,0)) then referring link want change vertical ticks factors of b
with refernce website
how 1 use code change labels
axis(2, at=null, labels=c("a", "b", "c", "d"))
use yaxt argument suppress y-axis in sunflowerplot(). see ?par:
yaxt
a character specifies y axis type. specifying "n" suppresses plotting.
sunflowerplot(x$b ~ x$a, main = "sunflower plot", xlab = "type a", ylab = "type b", size = 0.25, cex.lab = 1.5, mgp = c(2.5,1,0), yaxt="n") axis(2, at=1:4, labels=c("a", "b", "c", "d")) 
Comments
Post a Comment