https://liuxingming.blog.csdn.net/article/details/47427453?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-6.control&dist_request_id=1619594496511_22734&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-6.control
https://blog.csdn.net/zx403413599/article/details/48581713
https://blog.csdn.net/weixin_42568714/article/details/113073762
1. 删除刻度标签
plot() + theme(axis.text = element_blank())
2. 删除刻度线
plot() + theme(axis.ticks = element_blank())
3. 修改刻度显示范围和刻度间隔
scale_x_continuous(limits=c(起始值,终止值), breaks=seq(起始值, 终止值, 间隔))
scale_y_continuous(limits=c(起始值,终止值), breaks=seq(起始值, 终止值, 间隔))
4. 删除坐标轴线
plot() + theme(axis.line = element_blank())
ggplot(mtcars)+geom_bar(aes(x=cyl))+theme_cowplot() '#正常绘制坐标轴线,示例一
ggplot(mtcars)+geom_bar(aes(x=cyl))+theme_cowplot()+theme(axis.line = element_line(size=1, colour = "black")) #修改坐标轴线的粗细和颜色,示例二
ggplot(mtcars)+geom_bar(aes(x=cyl))+theme_cowplot()+theme(axis.line = element_line(size=0, colour = "black")) #通过修改坐标轴线的颜色删除坐标轴线,示例二
ggplot(mtcars)+geom_bar(aes(x=cyl))+theme_cowplot()+theme(axis.line = element_line(size=1, colour = "white")) #通过修改坐标轴线的粗度删除坐标轴线,示例二
ggplot(mtcars)+geom_bar(aes(x=cyl))+theme_cowplot()+theme(axis.line = element_blank())) #直接删除坐标轴线,示例二
示例一
示例二
网友评论