Getting started with data visualisations

Photo by Luca Micheli on Unsplash

Open your eyes and see the beauty!

This article aims to introduce readers to smart approaches to visualise data. Whether we perform exploratory data analysis where the goal is to understand data ourselves or perform explanatory data analysis where we need to communicate to the end users, data visualisations can facilitate in providing clear ideas. Due to abundant variety in the way data can be visualised, it can cause confusion to understand the purpose and context of using a suitable representation. Choosing a wrong method of data visualisation can cause misinterpretation of data leading towards bad decision making. In the first article on our visualisation series, we discuss different types of bar charts such as horizontal, vertical and stacked bar charts. Throughout this series, we will use the Irish data to bring across how Ireland fared since COVID-19 outbreak in the country.

Types of bar charts

Bar charts are good illustrations for conveying changes over time. Be it a company’s sales performance year on year or comparing population dynamics with different types of bar charts one can easily incorporate flexibility in representations. The types of bar charts are vertical bar charts which are effective to represent time series data as space on x-axis is small so it can be ideally used to represent years, months, weeks and date. On the other hand due to lack of space on x-axis and if faced with nominal variables such as types of organisations, names of countries, types of sports, meal types or flavours of ice creams or soft drinks, horizontal bar charts are best ways of representations for all the above contexts. A third kind of bar chart is the stacked bar chart that can be used to represent multiple types of values within a single bar such as (male, female: gender, coursera, udemy, edx: online platform etc.)

Let us now plot the different types of bar graphs.

Vertical Bar Graph

For the vertical bar graph, we have used the data that explain the distribution of confirmed cases according to age groups in Ireland for the month of March 2020. The data is converted to .csv and used for plotting a vertical bar graph. From the graph, we can see that the age group greater than 65 is most affected with COVID in March 2020.

Vertical bar graph representing number of confirmed covid cases in March 2020 according to age groups

Horizontal Bar Graph

For the horizontal bar graph, we will analyse the data for the number of confirmed cases across the counties in Ireland. From the timestamp column, we have extracted the data till March 2021 with the function DatetimeIndex() from the pandas library. Then we will plot a horizontal bar graph across counties to show the total number of cases reported by each till March 2021. As we can see Dublin County was the most affected in Ireland.

Horizontal bar graph representing number of cumulative confirmed covid cases across counties till march 2021

Stacked Bar Graph

For stacked bar graphs, we will use the data from here. Stacked bar graphs are used for comparative analysis of multiple columns. The logic behind plotting stacked bar plots is to use the peak of one column as the base of another. The plot below shows the cumulative sum of cases since outbreak in March 2020 to January 21, February 21, March 21 and till 22nd, April 21. From this we can gain insights into the total number of confirmed COVID cases since outbreak , the number of deaths in Ireland and the total number of people requiring hospitalisations since outbreak.

Statistical analysis of of COVID with cumulative sum till April 2021

The entire code can be found here.

Takeaways

Data visualisations are able to communicate meaningful information to end users in a way comprehensible through plots thus making it easy to gain critical insights from data. Data visualisation is not only an important tool for data scientists and data analysts but a powerful business analytics tool for marketing, design, media communications, etc.

Do you have any questions?

Kindly ask your questions via email or comments and we will be happy to answer :)

--

--

Insights on Modern Computation
Perspectives on data science

A Communal initiative by Meghana Kshirsagar (BDS| Lero| UL, Ireland), Gauri Vaidya (Intern|BDS). Each concept is followed with sample datasets and Python codes.