-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Code example, using theme() to control the size and shape of the legend key items:
library(treemapify)
plot_11 <- ggplot(diamonds %>% head(12),
aes(area = carat, fill = color, label = color,
subgroup = cut, subgroup2 = color)) +
geom_treemap(size = 3) +
# geom_treemap_subgroup_border(color = "grey", size = 20) +
geom_treemap_subgroup2_border(color = "grey", size = 2) +
geom_treemap_subgroup_text(place = "center", grow = FALSE, alpha = 0.5, colour =
"black", fontface = "italic", min.size = 2,
padding.x = grid::unit(3,"mm"), padding.y = grid::unit(3,"mm") ) +
theme(legend.key.size = unit(1, "cm"),
legend.key.width = unit(0.3, "cm")) +
theme(legend.background = element_rect(fill = 'grey'))
plot_11
However, when geom_treemap_subgroup_border() is uncommented to introduce some separation between major groupings, the legend key sizing no longer works:

(Actually, it partly works. Values of legend.key.size bigger than 2 cm will take effect.)
Is there a way to use both features fully?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
