facet_wrap in treemap

Hello!
I'd like to generate a treemap like this one, with the subgroup labels in the black rectangles.
image

For my treemap I'm using:

ggplot(20CTG_WSC_BP_CC_MF, aes(area = enrichment_ratio, fill = FDR, label = paste(description, overlap, sep = "\n"), subgroup = enrich_cat)) + geom_treemap() + geom_treemap_text(colour = "white", place = "centre", size = 15, reflow = TRUE) + scale_colour_gradientn(colours = "colour") + geom_treemap_subgroup_border(colour = "white", size = 5)

I tried facet_wrap , but it divides my subgroups in 3 parallel blocks

ggplot(20CTG_WSC_BP_CC_MF, aes(area = enrichment_ratio, fill = FDR, label = paste(description, overlap, sep = "\n"), subgroup = enrich_cat)) + geom_treemap() + geom_treemap_text(colour = "white", place = "centre", size = 15, reflow = TRUE) + scale_colour_gradientn(colours = "colour") + geom_treemap_subgroup_border(colour = "white", size = 5) + facet_wrap( ~ enrich_cat)

thanks!


this is my map without facet_wrap

and after facet_wrap:


I don't like the 3 parallel blocks...

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.