Skip to content
master
Go to file
Code
This branch is 7 commits ahead of ellisp:master.

Latest commit

Now we can grid.export SVG plots using the gridSVG package. However,
the plot bounds come out a little odd. I found that taking the width
height specified in the `<g id="layout.2">` and substituting the ones
in the root `<svg>` and its direct `<g>` child for it fixed the issue.
I'd like to work out what's causing the incorrect height and width tho.

Also, flags are getting trimmed when they spill over the plotting area.
I'm not sure whether this is desirable behaviour (it does not happen with
`ggsave` or when viewing directly in Rstudio).
401494a

Git stats

Files

Permalink
Failed to load latest commit information.

README.md

ggflags

flag geom for ggplot2

library(ggflags)

set.seed(1234)
d <- data.frame(x=rnorm(50), y=rnorm(50), 
                country=sample(c("ar","fr", "nz", "gb", "es", "ca"), 50, TRUE), 
                stringsAsFactors = FALSE)
ggplot(d, aes(x=x, y=y, country=country, size=x)) + 
  geom_flag() + 
  scale_country() +
  scale_size(range = c(0, 15))

The flag SVG assets, used under the CC-BY licence, are taken from the EmojiOne set: https://github.com/eosrei/emojione-color-font

(Note: the EmojiOne set doesn't include UK counties or US states!)

(note: proof of principle only)

About

A flag geom for ggplot2. Tweaks the original by using round flags (great for plotting as points).

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.