我想在 ggplot2 poar 圖中顯示 theta 軸的刻度線。但是,theme() 中的axis.ticks.y 和axis.ticks.y 都不適用于theta 軸。任何幫助將不勝感激,謝謝
library(ggplot2)
df <- data.frame(
start = c(0, 121, 241),
end = c(120, 240, 359),
group = letters[1:3]
)
# a example circular ring plot
base <- ggplot(df, aes(ymax = end, ymin = start,
xmin = 0.8, xmax = 1,
fill = group))
geom_rect()
coord_polar(theta = "y")
xlim(c(0, 1))
base

# the tick of y axis can be changed
base theme(axis.ticks.y = element_blank(), axis.text.y = element_blank())

# set the tick of x axis not worked for the theta axis
base theme(axis.ticks.x = element_line(color = "black", size = 2))

感謝@Vishal A.,從
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/398479.html
