Visualizing comparisons in your data
Comparisons are very common in data analysis and there are different ways to present them. Starting with the bar chart, you must have seen many reports that have used this type of visualization.
Bar charts can be used to compare one variable among different classes – for example, a car’s price across different models or population size per country. In Figure 5.3, the bar chart is used to analyze the percentage of positive tests for COVID-19 in a range of regions of India as of April 7th, 2020.
Figure 5.3 – Plotting comparisons with a bar chart (source: State Health Department of India)
Sometimes, you can also use stacked column charts to add another dimension to the data that is being analyzed. For example, Figure 5.4 uses a stacked bar chart to show how many people were on board the Titanic by sex. Additionally, it breaks down the number of people who survived (positive class) and those who...