R语言中ggplot2绘图如何同时清除灰色背景、框格、上框线和右框线

 

001、测试基本绘图

data=iris                               ## 导入数据
library(ggplot2)                        ## 加载包
ggplot(data = data, aes(x=Petal.Length,y=Sepal.Length)) +       ## 基本绘图程序 
  geom_point()

 

 

002、清除灰色背景、背景框线、上框线、右框线

data=iris
library(ggplot2)
library(cowplot)                              ##  使用cowplot包
ggplot(data = data, aes(x=Petal.Length,y=Sepal.Length)) + 
  geom_point() + theme_cowplot()              ## 增加 + theme_cowplot()语句

 

posted @   小鲨鱼2018  阅读(3029)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2021-09-09 c primer plus 10 编程练习
点击右上角即可分享
微信分享提示