Title: | Plot flags of the world in ggplot2 |
---|---|
Description: | A ggplot2 extension that allows you to plot the flags of the world. It functions essentially as geom_point does, requiring, at minimum, a two-letter lowercase country code for the country aesthetic, and x and y aesthetics. You can also adjust the size. |
Authors: | Baptiste Auguie [aut, cre],
James Goldie [aut, ctb] |
Maintainer: | Baptiste Auguie <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.4 |
Built: | 2025-02-19 05:29:22 UTC |
Source: | https://github.com/jimjam-slam/ggflags |
flag geom for ggplot2
geom_flag( mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )
geom_flag( mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )
mapping |
mapping |
data |
data |
stat |
stat |
position |
position |
na.rm |
na.rm |
show.legend |
show.legend |
inherit.aes |
inherit.aes |
... |
... |
data(lflags) set.seed(1234) 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, size = x)) + geom_flag() + scale_country()
data(lflags) set.seed(1234) 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, size = x)) + geom_flag() + scale_country()
List of country flags
lflags
lflags
A list of 256 elements of class S4 ('grImport::Picture'), with:
PictureGroup
PictureDefinitions
PictureSummary
...
scale countries
scale_country(..., guide = "legend")
scale_country(..., guide = "legend")
... |
... |
guide |
guide |