jimjam-slam / ggflags

A flag geom for ggplot2. Tweaks the original by using round flags (great for plotting as points).
91 stars 14 forks source link

Plot SVGs (or another vector format) instead of PNGs #1

Closed jimjam-slam closed 6 years ago

jimjam-slam commented 6 years ago

baptiste/ggflags plots PNGs, which is fine if you just want the points positioned but not sized. But if you decide to make big points, or bind flag size to an aesthetic, you either need bigger PNGs (in which case the package size blows out), or you need to accept poor image quality.

I'd prefer to plot SVGs, especially as most of the open source emoji sets like EmojiOne and Twemoji have SVG assets available. I think this can be done by pre-processing the SVGs to be Cairo-compatible with grConvert and then rendering them with grid.symbol() or grid.picture(). Maybe grobify()?

jimjam-slam commented 6 years ago

It woooooooooooorks (closes #1)