r - 在R中的ggplot中删除图例中的重复项
问题描述
我的图例中有一个烦人的重复数据和下面的代码,我正在努力删除:
ggplot(communitiesdata1, aes(`avg time to first response?`, `response rate`)) +
geom_point(shape=21,
aes(fill=helpfulness, stroke=0.1,
colour = helpfulness,
size=`threads active in past 30 days`)) +
scale_fill_gradient2(high="red", low="blue", midpoint = mid) +
geom_text_repel(aes(label=community,
),
size = 3, # font size in the text labels
point.padding = 0, # additional padding around each point
box.padding = 0.3, # additional padding around each text label
) +
labs(title = "Community Category Performance - Jan 2021",
y = "Response Rate %",
x = "Avg. time to first response (mins)") +
theme_classic() +
theme(aspect.ratio = 1, axis.text=element_text(size=9), axis.title=element_text(size=9), plot.title = element_text(size=10, hjust=0.5), legend.title=element_text(size=7),
legend.text=element_text(size=6))
这给了我以下结果:
有谁知道如何删除图例中的重复项?我想删除第一个(浅到深蓝色渐变)
解决方案
推荐阅读
- android - gridview.count 不会滚动颤动
- javascript - 我可以使用 webcal 访问 ics 文件并直接添加事件而无需订阅吗?
- python - 我们如何使用 python 在 Windows 中找到活动窗口名称?
- android - 在 AppAuth for Android 中结束会话而不卸载应用程序
- reactjs - 出现错误:TypeError: tag[primaryAttributeKey].toLowerCase 不是 React Helmet 中的函数
- node.js - 更新温斯顿记录器
- angular - 删除角度材料中列表项之间的填充
- python - 如何将python的“打印”写入txt文件?
- rust - 转化 Vec
到 Vec<[u8; 否]> - go - 如何为 go-chi 设置上下文路径?