我正在尝试创建基本的棒棒糖图并遇到问题。我修改了一些旧代码,这些代码可以在另一个数据集上创建棒棒糖图,但是在我的新数据集上效果不佳。
cms<-subset(centuryscoresletters, school=='CMS')
ggplot(data=cms, aes(x=id, y=mone))
geom_segment( aes(x=id, xend=id, y=0, yend=mone)) +
geom_point( size=3, color="red", fill=alpha("red", 0.3),
alpha=0.7, shape=16, stroke=1) + #shape=15 square, 8=star#
theme_light() #code down here adjusts the background grid#
theme(
panel.grid.major.x = element_blank(),
panel.border = element_blank(),
axis.ticks.x = element_blank()
) +
xlab("") +
ylab("Value of Y")