如何删除Boxplot上的刻度标记

问题描述 投票:0回答:1

我试图从我的箱线图中删除x轴刻度线,但保持标记与刻度线相关联。这可能在基地R?

colors <-c("lightskyblue3", "gray78","gold1", "wheat1")
boxplot(avgscore~module, data=microbox,
names=c("Cultural Diversity","UDL","Differentiated", "Instruction","Classroom Management"),ylim = range(2.5,4.5), ylab="Average Score", 
# main="Distribution of Average Score by Module",#
col=(c("lightskyblue3", "gray78","gold1", "wheat1")))

r
1个回答
0
投票

首先用xaxt = "n"抑制x轴,然后用axis添加tick = FALSE

graphics.off()
b = boxplot(mpg~cyl, mtcars, names = c("four", "six", "eight"), xaxt = "n")
axis(side = 1, at = seq_along(b$names), labels = b$names, tick = FALSE)
© www.soinside.com 2019 - 2024. All rights reserved.