Georgios Karamanis |||

For this week’s #TidyTuesday I recreated the scoreboard from this year’s Eurovision with ggplot.

code on GitHub

 

Here is a mini tutorial:

I used this image as reference

Arranging the ranks, flags, country names and points was pretty straightforward. I used {ggimage} for the flags, after getting iso2c codes from the country names with {countrycode}

At this point I was quite happy with the plot but I wanted to try filling the bars behind each country with a gradient fill. For that, I created a rect grob with {grid} and used linearGradient() for the fill. I then used {ggpp}’s geom_grob() to place and resize the grob

The background highlights were made with a circle grob, this time filled with a radialGradient(). I once again used geom_grob() to place the grob in two different positions with different sizes

The last thing I wanted to fix was the flags of Switzerland and Belgium that were breaking out of the background bars. I thought of changing the aspect ratio or size of those two flags in geom_image(), but that would either distort them or make them too small

In the reference image all the flags had the same aspect ratio, so I thought I should try masking the flags. For that I used with_mask() from {ggfx}. Here are the masks overlayed on the flags as rectangles, everything outside the grey part would not be visible

Not perfect but I considered it a success!

Here is the reference image and the final plot side by side. I considered recreating the cymatic pattern (https://eurovision.tv/mediacentre/logos-and-artwork) in the background but I quickly realised that it would be impossible 😀

Up next TidyTuesday 2022/19 TidyTuesday 2022/21
Latest posts TidyTuesday 2024/49 30DayMapChallenge 2024 TidyTuesday 2024/48 TidyTuesday 2024/47 TidyTuesday 2024/46 TidyTuesday 2024/45 TidyTuesday 2024/44 TidyTuesday 2024/43 TidyTuesday 2024/42 TidyTuesday 2024/41 TidyTuesday 2024/40 TidyTuesday 2024/39 TidyTuesday 2024/38 TidyTuesday 2024/37 TidyTuesday 2024/36 TidyTuesday 2024/35 TidyTuesday 2024/34 TidyTuesday 2024/33 TidyTuesday 2024/32 TidyTuesday 2024/31 TidyTuesday 2024/30 TidyTuesday 2024/29 TidyTuesday 2024/28 TidyTuesday 2024/27 TidyTuesday 2024/26 TidyTuesday 2024/25 TidyTuesday 2024/24 TidyTuesday 2024/23 TidyTuesday 2024/22 TidyTuesday 2024/21 TidyTuesday 2024/20