Data Visualisation Techniques

STA1506 - Basic Statistical Computing · Exploring Data

Data Visualisation Techniques

Data visualisation is the graphical representation of information and data. By using visual elements like charts, graphs, and maps, data visualisation tools provide an accessible way to see and understand trends, outliers, and patterns in data.

Importance of Data Visualisation

Data visualisation helps in making complex data more understandable. It allows you to see relationships, patterns, and trends that might not be obvious in raw data tables. Effective visualisations can communicate information clearly and efficiently.

Types of Data Visualisation Techniques

There are various data visualisation techniques, each suited for different types of data and analysis. Here are some common types:

  • Bar Charts: These are used to compare quantities across different categories. Each bar represents a category, and the length of the bar shows the value of that category.
  • Histograms: These are similar to bar charts but are used for continuous data. They show the distribution of a dataset by dividing it into intervals (bins).
  • Pie Charts: These show proportions of a whole. Each slice of the pie represents a category's contribution to the total.
  • Line Graphs: These are used to display data points over time. They are useful for showing trends.
  • Scatter Plots: These show the relationship between two numerical variables. Each point represents an observation.

Bar Charts

Bar charts are one of the simplest forms of data visualisation. They allow you to compare different groups or categories. Here is how to create a bar chart:

Example: Creating a Bar Chart

Suppose you have the following data on sales of different fruits:

Fruit:       Sales (in units):
Apple:       50
Banana:      30
Cherry:      20
Date:        40

You can create a bar chart to represent this data.

Steps to Create a Bar Chart

  1. Identify the categories (in this case, fruits).
  2. Identify the values (sales units).
  3. Draw the axes: the horizontal axis (x-axis) will represent the fruits, and the vertical axis (y-axis) will represent the sales.
  4. Draw bars for each fruit according to their sales values.

The resulting bar chart will visually represent the sales of each fruit.

Remember: When creating bar charts, ensure that the bars are of equal width and are spaced evenly.

Histograms

Histograms are used to represent the frequency distribution of numerical data. They help to understand the underlying frequency distribution of a set of continuous data points.

Example: Creating a Histogram

Consider the following data set representing the ages of a group of people:

Ages: 22, 25, 25, 27, 30, 30, 30, 32, 35, 38, 40, 42, 45

To create a histogram, follow these steps:

Steps to Create a Histogram

  1. Determine the range of the data (minimum and maximum values).
  2. Divide the range into intervals (bins). For example, you could use bins of 5 years: 20-25, 26-30, 31-35, 36-40, 41-45.
  3. Count how many data points fall into each bin.
  4. Draw the histogram with bins on the x-axis and frequency on the y-axis.

The histogram will show how many people fall into each age group.

Watch out: Ensure that the bins do not overlap. Each data point should fit into only one bin.

Pie Charts

Pie charts are useful for showing proportions. They give a quick view of how different categories contribute to the whole.

Example: Creating a Pie Chart

Suppose you have the following market share data for four companies:

Company A: 40%
Company B: 30%
Company C: 20%
Company D: 10%

To create a pie chart, follow these steps:

Steps to Create a Pie Chart

  1. Calculate the total percentage (should be 100%).
  2. Draw a circle to represent the whole.
  3. Divide the circle into slices according to the percentage of each company.

The pie chart will visually represent the market share of each company.

Tip: Use contrasting colours for each slice to improve readability.

Line Graphs

Line graphs are ideal for showing trends over time. They connect individual data points with lines.

Example: Creating a Line Graph

Consider the following data representing the temperature over a week:

Day:      Temperature (°C):
Monday:   20
Tuesday:  22
Wednesday: 21
Thursday: 23
Friday:   25
Saturday: 24
Sunday:   26

To create a line graph, follow these steps:

Steps to Create a Line Graph

  1. Identify the x-axis (days of the week) and y-axis (temperature).
  2. Plot each data point on the graph.
  3. Connect the points with a line.

The line graph will show how temperature changes throughout the week.

Watch out: Ensure that the points are connected only if they represent continuous data.

Scatter Plots

Scatter plots are used to show the relationship between two numerical variables. Each point represents an observation.

Example: Creating a Scatter Plot

Suppose you have data on the hours studied and the corresponding test scores:

Hours:  1, 2, 3, 4, 5
Scores: 50, 60, 65, 70, 80

To create a scatter plot, follow these steps:

Steps to Create a Scatter Plot

  1. Identify the x-axis (hours studied) and y-axis (test scores).
  2. Plot each pair of values as a point on the graph.

The scatter plot will show whether there is a relationship between hours studied and test scores.

Tip: Look for patterns in the scatter plot to identify correlations.

Choosing the Right Visualisation

Choosing the correct visualisation technique depends on the type of data you have and the message you want to convey. Here are some guidelines:

  • Use bar charts for categorical data.
  • Use histograms for continuous data distributions.
  • Use pie charts for showing parts of a whole.
  • Use line graphs for trends over time.
  • Use scatter plots for relationships between two variables.

Conclusion

Data visualisation is a vital skill in statistical computing. By using the appropriate techniques, you can effectively communicate your findings and insights. Practice creating different types of visualisations to become proficient.

Check your understanding

  • What is the main purpose of data visualisation?
  • Describe the steps to create a histogram.
  • When should you use a pie chart instead of a bar chart?
  • What does a scatter plot illustrate?