[英]How to use `key_glyph` with `geom_jitter`?
The following does not add anything to the legend:以下内容不会向图例添加任何内容:
ggplot(diamonds, aes(x = color, y = table, color = cut)) +
geom_jitter(key_glyph = draw_key_rect)
draw_key_point
works, draw_key_dotplot
does to. draw_key_point
有效, draw_key_dotplot
有效。 draw_key_rect
also perfectly works with geomtries like geom_line
or geom_linerange
. draw_key_rect
也可以完美地与geom_line
或geom_linerange
等几何图形一起使用。 How can I use it with points?如何使用积分?
Add the aesthetic fill
for rect为矩形添加美学fill
library(tidyverse)
diamonds %>%
ggplot()+
geom_jitter(aes(x=color, y=table,
color=cut,
fill=cut),
key_glyph = draw_key_rect)
Created on 2020-12-01 by the reprex package (v0.3.0)由代表 package (v0.3.0) 于 2020 年 12 月 1 日创建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.