摘要: 001、默认绘图 bp <- ggplot(PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 输出图片 002、上部 bp + theme(legend.position="top") ## 放 阅读全文
posted @ 2023-03-23 18:10 小鲨鱼2018 阅读(684) 评论(0) 推荐(0) 编辑
摘要: 001、正常绘图 library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() bp ## 显示绘图结果 002、修改图例标题的名称 bp + scale_fi 阅读全文
posted @ 2023-03-23 17:31 小鲨鱼2018 阅读(2119) 评论(0) 推荐(0) 编辑
摘要: 001、正常绘图,显示图例 library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 显示绘图 绘图结果如下: 002、隐藏图例的标 阅读全文
posted @ 2023-03-23 17:22 小鲨鱼2018 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 001、直接绘图效果: library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 显示绘图结果 绘图结果如下: 002、修改图例显示 阅读全文
posted @ 2023-03-23 17:14 小鲨鱼2018 阅读(638) 评论(0) 推荐(0) 编辑
摘要: 001、 a、利用测试数据绘制箱线图 library(ggplot2) bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 显示绘图结果 绘图结果如下: b、移 阅读全文
posted @ 2023-03-23 17:05 小鲨鱼2018 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 001、使用绘制散点图进行测试。 a、直接绘制散点图 x <- 1:10 y <- seq(1, 1000, 100) dat <- data.frame(x, y) ## 生成测试数据 ggplot(dat, aes(x, y)) + geom_point() ## 直接绘制散点图 绘图结果如下: 阅读全文
posted @ 2023-03-23 16:44 小鲨鱼2018 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 001、 利用绘制散点图进行测试 a、直接绘制散点图 x <- 1:10 y <- seq(1, 1000, 100) dat <- data.frame(x, y) ## 生成测试数据 ggplot(dat, aes(x, y)) + geom_point() ## 直接绘制散点图 绘图结果如下: 阅读全文
posted @ 2023-03-23 16:05 小鲨鱼2018 阅读(158) 评论(0) 推荐(0) 编辑