<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>The code behind the visuals</title>
    <link>https://codebase.giorgiocomai.eu/</link>
    <description>Recent content on The code behind the visuals</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 25 Jul 2017 08:48:51 -0700</lastBuildDate>
    
	<atom:link href="https://codebase.giorgiocomai.eu/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Explore the Instagram API based on the cast of &#34;Severance&#34;</title>
      <link>https://codebase.giorgiocomai.eu/2025/01/19/explore-the-instagram-api-based-on-the-cast-of-severance/</link>
      <pubDate>Sun, 19 Jan 2025 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2025/01/19/explore-the-instagram-api-based-on-the-cast-of-severance/</guid>
      <description>A preliminary note This post largely relies on package for the R programming language I’ve been working on, that is still under development. Its name is cornucopia. Why call it cornucopia? It’s a tongue-in-cheek reference to marketers always thinking about conversion funnels: ultimately, a cornucopia is like a funnel that keeps on giving. Also known as the “horn of plenty”, it’s basically a marketer’s wildest dream: a funnel that endlessly overflows with abundance.</description>
    </item>
    
    <item>
      <title>Election forecasting visualised as an airplane seating chart</title>
      <link>https://codebase.giorgiocomai.eu/2024/11/05/election-forecasting-visualised-as-an-airplane-seating-chart/</link>
      <pubDate>Tue, 05 Nov 2024 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2024/11/05/election-forecasting-visualised-as-an-airplane-seating-chart/</guid>
      <description>Here are 538’s final forecasts for recent elections, shown as if for a seating chat for a booking system of an airline.
Source for election forecast data, fivethirtyeight.com:
 2016 2020 2024  These include also the unlikely chance of none of the sides reaching 270 electoral college seats (mostly, because of 768 parity, but plausibly, because of 1 or more electoral college seats going to third party candidates). As in most years the chance appears close to 0.</description>
    </item>
    
    <item>
      <title>Italian-provinces-themed juice caps - an exploration</title>
      <link>https://codebase.giorgiocomai.eu/2024/09/16/italian-provinces-themed-juice-caps-an-exploration/</link>
      <pubDate>Mon, 16 Sep 2024 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2024/09/16/italian-provinces-themed-juice-caps-an-exploration/</guid>
      <description>Following this post, you will find out how to:
 match province identifiers to a map (easy!) make a palette based on the prevalent colour of a set of images (easier than I thought) place a set of png images on a ggplot canvas (the trick part is adapting size to the number of caps) place png images on an interactive leaflet map (always fancy) estimate how many bottles of juice you’re supposed to drink in order to finish your collection (serious questions) build a wasm-based, server-less shiny app with all of the above (so much wisdom can’t be accessible only to those who code)  In May 2024, Italian brand “Yoga” has started to place on caps of its small glass bottles of fruit juice a set of decorations themed after Italian cities (“Tutte le mie città”).</description>
    </item>
    
    <item>
      <title>Finding gendered street names. A step-by-step walkthrough with R</title>
      <link>https://codebase.giorgiocomai.eu/2021/07/15/finding-gendered-street-names.-a-step-by-step-walkthrough-with-r/</link>
      <pubDate>Thu, 15 Jul 2021 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2021/07/15/finding-gendered-street-names.-a-step-by-step-walkthrough-with-r/</guid>
      <description>EDJNet has recently released the first pilot version of “Mapping diversity”: it shows for the main city in each of Italy’s regions how many streets are dedicated to men and women and includes details about who these streets were dedicated to. In a visually impressive format developed by Sheldon.studio with text and analysis by Alice Corona, it highlights that many more streets are dedicated to men than to women, and that many of those women are Catholic saints or other religious figures.</description>
    </item>
    
    <item>
      <title>Visualising risk: a modern implementation of the Risk Characterisation Theatre</title>
      <link>https://codebase.giorgiocomai.eu/2021/04/29/visualising-risk-a-modern-implementation-of-the-risk-characterisation-theatre/</link>
      <pubDate>Thu, 29 Apr 2021 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2021/04/29/visualising-risk-a-modern-implementation-of-the-risk-characterisation-theatre/</guid>
      <description>A different visual approach to associate likelihood of occurrence of a given event to the lived experience of people viewing the graph.
In their 2007 book “The illusion of certainty: Health Benefits and Risks”, authors Erik Rifkin and Edward Bouwer addressed a number of aspects related to the communication of risk to individuals and broad audiences, arguing that adequate communication of risk, including on the uncertainty embedded in risk assessments, is fundamental to personal and collective deliberations.</description>
    </item>
    
    <item>
      <title>How do data grids look on a map? [3D video]</title>
      <link>https://codebase.giorgiocomai.eu/2020/08/14/how-do-data-grids-look-on-a-map-3d-video/</link>
      <pubDate>Fri, 14 Aug 2020 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2020/08/14/how-do-data-grids-look-on-a-map-3d-video/</guid>
      <description>In this video, I point at some of the issues that characterise data grids and that may generate misunderstandings.
  In the video, I mention how gridded data can be generated via satellite imagery and machine learning techniques. Of course, such data can be generated also via other means.
References This video is based on the data used for this article: Climate warming in Europe, municipality by municipality
Municipality-level data for Italy can be accessed through this interactive interface: In marcia con il clima</description>
    </item>
    
    <item>
      <title>Google Earth Studio as a data visualisation tool (with R)</title>
      <link>https://codebase.giorgiocomai.eu/2020/08/13/2020-08-google-earth-studio/</link>
      <pubDate>Thu, 13 Aug 2020 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2020/08/13/2020-08-google-earth-studio/</guid>
      <description>Google Earth Studio is a fancy tool that allows for the creation of videos of stunning quality, by making it possible to create smooth transitions between locations across the globe, zooming in closer to the ground, and showing mountains and cities in 3D.
Here is their own promo video:
  However, so far I have not really seen it used for data visualisation, nor I have seen any post online discussing how to use Google Earth Studio with data.</description>
    </item>
    
    <item>
      <title>Beautiful Gantt charts with ggplot2</title>
      <link>https://codebase.giorgiocomai.eu/2020/06/03/ganttrify-gantt-charts-ggplot2-r/</link>
      <pubDate>Wed, 03 Jun 2020 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2020/06/03/ganttrify-gantt-charts-ggplot2-r/</guid>
      <description>The prequel Among the many things that the Covid-19 brought to journalism, there is one that is both a boon and a bane: grants. As the pandemic brought new challenges to the sustainability of many media organisations, a number of initiatives and donors stepped up to provide financial assistance to media organisations and journalists. In many cases, the application process was mercifully straightforward, also due to the urgency of the matter: a brief form was all that was needed to apply to some of these funding lines.</description>
    </item>
    
    <item>
      <title>How to find the population-weighted centre of local administrative units</title>
      <link>https://codebase.giorgiocomai.eu/2020/03/25/population-weighted-centre/</link>
      <pubDate>Wed, 25 Mar 2020 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2020/03/25/population-weighted-centre/</guid>
      <description>Preliminary note: All code for this post is available at this link. Various operations described in these posts were facilitated by a new R package, latlon2map; the package has already a basic vignette, with the title “Removing the boring parts from geocomputation with European data”.
For a number of data visualisations and data analysis it is useful to have the coordinates of the centre of a town or municipality. In a lengthy post (in Italian), Andrea Borruso highlighted why this can be useful, pointed at a number of alternative solutions, and to some of their shortcomings.</description>
    </item>
    
    <item>
      <title>How to feel lucky on a Monday morning: calculating the travel distance between places and each point of the European population grid</title>
      <link>https://codebase.giorgiocomai.eu/2019/11/26/osrm-population-grid-calculate-distance/</link>
      <pubDate>Tue, 26 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2019/11/26/osrm-population-grid-calculate-distance/</guid>
      <description>Almost one million Romanian citizens cast their ballot for the second turn of the Romanian presidential elections in November 2019 from abroad, largely thanks to the fact that more than 800 polling stations around the world remained opened from Friday through Sunday over the election week-end. In some parts of Europe, polling stations were available not only in capital cities or major urban centers, but also in relatively remote locations.</description>
    </item>
    
    <item>
      <title>European Elections 2019 and Italy&#39;s varying size </title>
      <link>https://codebase.giorgiocomai.eu/2019/06/11/european-elections-2019-and-italy-s-varying-size/</link>
      <pubDate>Tue, 11 Jun 2019 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2019/06/11/european-elections-2019-and-italy-s-varying-size/</guid>
      <description>Among the many debates that follow elections, there is one that usually gets most attention among data journalists and people with an interest in data visualisation: electoral maps. This is not a purely aesthetic debate, as both newsreaders and political pundits make sense of election results through these maps, reaching often debatable conclusions.
A common one, for example, is the idea of a “country divided” as highlighted by Giuseppe Sollazzo in a post focused on maps published after the 2018 election in Italy.</description>
    </item>
    
    <item>
      <title>Animating &#39;One Degree Warmer&#39; time series with ggplot2 and gganimate</title>
      <link>https://codebase.giorgiocomai.eu/2018/10/17/one-degree-warmer-animating-time-series-with-ggplot-and-gganimate/</link>
      <pubDate>Wed, 17 Oct 2018 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2018/10/17/one-degree-warmer-animating-time-series-with-ggplot-and-gganimate/</guid>
      <description>A couple of weeks ago, the European Data Journalism Network (EdjNet) released a new dataset including yearly average temperatures between the year 1900 and 2017 for over 500 cities across Europe, and made it possible to find key data on each of them through an interactive web interface. Since these are lenghty and meaningful time series, I decided to use them to test-drive data animation with R with ggplot2+gganimate.1</description>
    </item>
    
    <item>
      <title>Tweeting above their weight</title>
      <link>https://codebase.giorgiocomai.eu/2018/01/18/tweeting-above-their-weight/</link>
      <pubDate>Thu, 18 Jan 2018 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2018/01/18/tweeting-above-their-weight/</guid>
      <description>The following graph presents the distribution of tweets by all members of the European Parliament who are on Twitter (divided by EP parliamentary group, per year):
 {&#34;x&#34;:{&#34;url&#34;:&#34;/post/2018-01-18-tweeting-above-their-weight_files/figure-html//widgets/widget_steamgraphTwitterN.html&#34;,&#34;options&#34;:{&#34;xdomain&#34;:&#34;*&#34;,&#34;allowfullscreen&#34;:false,&#34;lazyload&#34;:false}},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]} As a result of the fact that Twitter allows to retrieve systematically only the latest 3,200 tweet for each user, as highlighted in a previous post, the shape of the graph reflects not only the increasing number of MEPs on Twitter, but also this limitation: the further back in time, the less tweets are available.</description>
    </item>
    
    <item>
      <title>Meet the European Parliament&#39;s twittersphere</title>
      <link>https://codebase.giorgiocomai.eu/2018/01/17/meet-the-european-parliament-s-twittersphere/</link>
      <pubDate>Wed, 17 Jan 2018 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2018/01/17/meet-the-european-parliament-s-twittersphere/</guid>
      <description>This is the first in a series of posts on how members of the European Parliament (MEPs) appear on Twitter. The first post will introduce the EP twittersphere, outline limitations to the analysis, and point at some broad trends. The following posts will focus on specific aspects.
The dataset at the base of this and the following posts consists of 1,500,680 tweets (yes, about one and a half million tweets) posted by current MEPs.</description>
    </item>
    
    <item>
      <title>Exploring Putin&#39;s annual news conference</title>
      <link>https://codebase.giorgiocomai.eu/2017/12/15/exploring-putin-annual-news-conference/</link>
      <pubDate>Fri, 15 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2017/12/15/exploring-putin-annual-news-conference/</guid>
      <description>Downloading the speeches The full transcript of the Russian president’s annual news conference is available on the official website of the Kremlin, translated in English. Here are the direct links to each of the speeches:
  Year President Link    2017 Putin http://en.kremlin.ru/events/president/news/56378  2016 Putin http://en.kremlin.ru/events/president/transcripts/press_conferences/53573  2015 Putin http://en.kremlin.ru/events/president/transcripts/press_conferences/50971  2014 Putin http://en.kremlin.ru/events/president/transcripts/press_conferences/47250  2013 Putin http://en.kremlin.ru/events/president/transcripts/press_conferences/19859  2012 Putin http://en.</description>
    </item>
    
    <item>
      <title>Crisis? What Crisis?</title>
      <link>https://codebase.giorgiocomai.eu/2017/10/04/crisis-what-crisis/</link>
      <pubDate>Wed, 04 Oct 2017 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2017/10/04/crisis-what-crisis/</guid>
      <description>Looking at the archive of press releases and speeches published by the European Commission since 1985, it appears clearly that “crisis” entered the public vocabulary suddenly in 2008 and has quickly become a central keyword of public discourse, including that of EU institutions. 1
 {&#34;x&#34;:{&#34;url&#34;:&#34;/post/2017-10-04-crisis-what-crisis_files/figure-html//widgets/widget_hc_crisisFullTS.html&#34;,&#34;options&#34;:{&#34;xdomain&#34;:&#34;*&#34;,&#34;allowfullscreen&#34;:false,&#34;lazyload&#34;:false}},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]} Embed code:
&amp;lt;iframe src=&amp;quot;https://datavis.europeandatajournalism.eu/obct/giocomai/post/2017-10-04-crisis-what-crisis_files/figure-html/widgets/widget_hc_crisisFullTS.html&amp;quot; style=&amp;quot;width:100%;height:500px;border:none;&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt; Zooming in on recent years, it appears clearly that the frequency of mentions to ‘crisis’ boomed starting with September 2008 and attenuated somewhat in the spring of 2016.</description>
    </item>
    
    <item>
      <title>Interactive #SOTEU circle plots and wordclouds</title>
      <link>https://codebase.giorgiocomai.eu/2017/09/22/interactive-soteu-circle-plots-and-wordclouds/</link>
      <pubDate>Fri, 22 Sep 2017 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2017/09/22/interactive-soteu-circle-plots-and-wordclouds/</guid>
      <description>In a previous post, I described how I created the data visualisations that have been published by EUobserver, VoxEurope, and balcanicaucaso.org.
Some of the graphs were based on keywords selected by the editors, such as for example this graph:
Looking at it, you may have wondered: “but what about this other word?”
Interactive version of the circle plot Wonder no more! Now, it’s easy to find out through an interactive version of the same graph.</description>
    </item>
    
    <item>
      <title>Exploring #SOTEU speeches</title>
      <link>https://codebase.giorgiocomai.eu/2017/09/13/exploring-soteu-speeches/</link>
      <pubDate>Wed, 13 Sep 2017 00:00:00 +0000</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/2017/09/13/exploring-soteu-speeches/</guid>
      <description>This post offers different examples of data visualisation aimed at exploring “State of the Union” speeches since they have first been introduced in 2010 (the speech was not delivered in 2014 because of European Parliament elections). It highlights key steps in the procedure, and includes the actual code in the R programming language used to create them (hidden by default).
The source document can be downloaded from GitHub.
Downloading the speeches The full transcript of the speeches is available on the official website of the European Union.</description>
    </item>
    
    <item>
      <title>About</title>
      <link>https://codebase.giorgiocomai.eu/about/</link>
      <pubDate>Tue, 25 Jul 2017 08:48:51 -0700</pubDate>
      
      <guid>https://codebase.giorgiocomai.eu/about/</guid>
      <description>This blog presents the code used to analyse data, create new datasets, and new tools for exploring data within the project EDJnet. The full code that generates this website is available on GitHub.
All of the contents of this blog, including graphs and code, are distributed under a Creative Commons license (BY). In brief, you can use and adapt all of the above as long you acknowledge the source: Giorgio Comai/OBC Transeuropa/#edjnet</description>
    </item>
    
  </channel>
</rss>