--原文链接--
library(lemon)
data(diamonds)
ggplot(diamonds, aes(x=cut, y=price,color=clarity)) +
geom_point(position=position_jitter(width=0.2),size=0.2) +
coord_flex_cart(bottom=brackets_horisontal(), left=capped_vertical('both')) +
scale_color_manual(values=palette("Set1"))+
scale_y_continuous(limits=c(0,20000))+
theme_light() +
theme(panel.border=element_blank(), axis.line = element_line())
精彩推荐:
R语言绘制散点图geom_point
R语言添加拟合曲线geom_smooth
R语言箱线图boxplot
R语言线图geom_line