Closed jjbuonocore closed 11 months ago
Thanks for reporting this @jjbuonocore! I've pushed a fix to the development version and this will be released on CRAN soon.
library(ggplot2)
library(treemapify)
ggplot(G20, ggplot2::aes(area = gdp_mil_usd, fill = region,
color = econ_classification)) +
geom_treemap() +
scale_color_manual(values = c("red", "black"))
ggplot(G20, ggplot2::aes(area = gdp_mil_usd, fill = region,
color = econ_classification,
linetype = econ_classification)) +
geom_treemap() +
scale_color_manual(values = c("red", "black")) +
scale_linetype_manual(values = c(1,3)) +
guides(color = guide_legend(override.aes = list(color = c("red", "black"))))
Created on 2023-09-30 with reprex v2.0.2
I'm having some trouble getting the color aesthetic to show up in the legend. Working with the G20 example:
`ggplot2::ggplot(G20, ggplot2::aes(area = gdp_mil_usd, fill = region)) + geom_treemap()
works just fine`
ggplot(G20, ggplot2::aes(area = gdp_mil_usd, fill = region, color = econ_classification)) + geom_treemap() + scale_color_manual(values = c("red", "black"))
color does not show up in the legend
ggplot(G20, ggplot2::aes(area = gdp_mil_usd, fill = region, color = econ_classification, linetype = econ_classification)) + geom_treemap() + scale_color_manual(values = c("red", "black")) + scale_linetype_manual(values = c(1,3)) + guides(color = guide_legend(override.aes = list(color = c("red", "black"))))
fill shows up in a legend, along with linetype, but color does not`