2024-04-25 17:08:57 发布
网友
我使用ggplot for Python生成了以下图形。x轴代表五月的几天。你知道吗
有没有办法突出周末的几天?例如,在列weekend == 1时将标签加粗?你知道吗
weekend == 1
我试过在theme和geom_text内部使用aes,但没有效果。你知道吗
theme
geom_text
aes
你喜欢这个工作吗?(代码如下)
by_day <- data.frame( X=0:6, weekday=0:6, variable="Number_of_tweets", value=c(5820,6965,7415,6800,5819,1753,1137)) # install.packages("ggplot2", dependencies = TRUE) library(ggplot2) p <- ggplot(data=by_day, aes(x=weekday, y=value)) + geom_bar(stat = "identity") + scale_x_continuous(breaks=0:6, labels=c("Mon","Tue","Wed","Thu","Fri","Sat","Sun")) p + theme(axis.text=element_text(face=rep(c("plain", "bold"), c(5,2))))
你喜欢这个工作吗?(代码如下)
相关问题 更多 >
编程相关推荐