We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems it is not currently possible to customize the country names on the legend, either by capitalization or full names.
library(ggflags) # Capitalized country names don't work d <- data.frame( x = rnorm(10), y = rnorm(10), country = sample(c("AR", "FR"), 10, TRUE), stringsAsFactors = FALSE ) ggplot2::ggplot(d, ggplot2::aes(x = x, y = y, country = country)) + geom_flag() + scale_country() #> Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'grobify' for signature '"NULL"' # Lower case works p <- ggplot2::ggplot(d, ggplot2::aes(x = x, y = y, country = tolower(country))) + geom_flag() + scale_country() p
# Specifying legend labels is ignored p + ggplot2::scale_fill_discrete(labels = c("AR", "FR"))
p + ggplot2::scale_color_manual(labels = c("AR", "FR"))
p + ggplot2::scale_color_hue(labels = c("AR", "FR"))
Created on 2024-05-31 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It seems it is not currently possible to customize the country names on the legend, either by capitalization or full names.
Created on 2024-05-31 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: