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

Flags are rectangular, not circular #24

Closed ElliotJoyce09 closed 1 year ago

ElliotJoyce09 commented 1 year ago

Hello, wondering if you could help me. I have managed to use the package fine, but when it comes to plotting, the flags are rectangular, not circular. I was wondering if I was doing anything wrong on my end.

c76fab99-4e21-4789-8e78-ecbb4f46dbef

Code is here: ggplot(bundesliga_gca_2022_league, aes(x = GCA90_GCA, y = SCA90_SCA, country = nationality)) + geom_flag() + scale_size(range = c(0, 5)) + geom_hline(yintercept = mean(bundesliga_gca_2022_league$SCA90_SCA)) + geom_vline(xintercept = mean(bundesliga_gca_2022_league$GCA90_GCA))

ElliotJoyce09 commented 1 year ago

I now am trying with the same code and get this error:

Loading required package: grImport2 Error in UseMethod("as.raster") : no applicable method for 'as.raster' applied to an object of class "Picture"

jimjam-slam commented 1 year ago

Hi @ElliotJoyce09, my best guess here is that you've inadvertently installed a very old version of ggflags. The original version at https://github.com/baptiste/ggflags plotted rectangular flags. Do you know which version you were using?