Data Visualization
QMI1500 - Elementary Quantitative Methods · Descriptive Statistics
Data Visualization
Data visualization is the graphical representation of information and data. By using visual elements like charts, graphs, and maps, data visualization tools provide an accessible way to see and understand trends, outliers, and patterns in data.
Importance of Data Visualization
Data visualization is essential because it helps in presenting complex data in a clear and concise manner. It allows for quicker insights and better decision-making. For example, a table of numbers can be hard to interpret, but a bar chart can show trends at a glance.
Remember: Good data visualization can reveal insights that are not immediately apparent from raw data.
Types of Data Visualizations
There are several common types of data visualizations:
- Bar Charts: Used to compare quantities of different categories.
- Line Graphs: Used to show trends over time.
- Pie Charts: Used to show proportions of a whole.
- Histograms: Used to show the distribution of numerical data.
Bar Charts
A bar chart displays data with rectangular bars. The length of each bar is proportional to the value it represents. Bar charts are useful for comparing different groups or categories.
Example of a Bar Chart
Consider a small business that sells three types of fruit: apples, bananas, and oranges. The sales data for the last month is as follows:
- Apples: 120
- Bananas: 80
- Oranges: 100
To create a bar chart, follow these steps:
- Draw two axes: a vertical axis (y-axis) for sales and a horizontal axis (x-axis) for fruit types.
- Label the x-axis with the fruit types.
- Label the y-axis with the sales figures, ranging from 0 to 150.
- Draw a bar for each fruit type, where the height of the bar corresponds to the sales figures.
Fruit Types: Apples Bananas Oranges
Sales: 120 80 100
Bar Chart:
| | |
| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
|___|__________|__________|__________|
Apples Bananas OrangesLine Graphs
A line graph connects individual data points with lines. This type of graph is particularly useful for showing trends over time.
Example of a Line Graph
Suppose you track the monthly sales of a product over six months. The sales data is:
- January: 150
- February: 200
- March: 180
- April: 220
- May: 240
- June: 300
To create a line graph:
- Draw two axes: the x-axis for months and the y-axis for sales.
- Label the x-axis with the months.
- Label the y-axis with sales figures, ranging from 0 to 350.
- Plot each month's sales on the graph and connect the points with lines.
Months: January February March April May June
Sales: 150 200 180 220 240 300
Line Graph:
| |
| | *
| | *
| | *
| | *
| | *
|___|_____________________________
Jan Feb Mar Apr May JunPie Charts
A pie chart is a circular statistical graphic that is divided into slices to illustrate numerical proportions. Each slice represents a category's contribution to the total.
Example of a Pie Chart
Imagine you have the following data on market share for four companies:
- Company A: 40%
- Company B: 30%
- Company C: 20%
- Company D: 10%
To create a pie chart:
- Draw a circle.
- Calculate the angle for each slice by using the formula: (percentage / 100) × 360 degrees.
- Draw each slice based on the calculated angles.
Company A: (40/100) × 360 = 144 degrees
Company B: (30/100) × 360 = 108 degrees
Company C: (20/100) × 360 = 72 degrees
Company D: (10/100) × 360 = 36 degrees
Pie Chart:
| Company A |
| |
| * |
| * * |
| * * |
| * * |
| * * |
| * * |
| * * |
|* *|
|---------------------|
| Company B |
| Company C |
| Company D |Histograms
A histogram is a type of bar chart that represents the frequency distribution of numerical data. It groups data into ranges (bins).
Example of a Histogram
Consider the following data representing the ages of 20 individuals:
- 15, 22, 22, 24, 25, 25, 25, 30, 33, 34, 35, 36, 36, 40, 42, 45, 45, 46, 48, 50
To create a histogram:
- Decide on the range of ages (e.g., 10-19, 20-29, etc.).
- Count how many individuals fall into each range.
- Draw the histogram with bars for each age range, where the height represents the frequency.
Age Range: 10-19 20-29 30-39 40-49 50-59
Frequency: 0 5 4 5 1
Histogram:
| |
| | |
| | | |
| | | | |
| | | | |
|___|_________|_________|_________|
10-19 20-29 30-39 40-49 50-59Watch out: Ensure that the bins in a histogram are of equal width. Unequal bins can misrepresent the data.
Best Practices for Data Visualization
When creating data visualizations, consider the following best practices:
- Choose the right type of chart for your data.
- Keep it simple and avoid clutter.
- Use labels and legends to make your chart easy to understand.
- Ensure that colours are distinct and accessible.
Tip: Always test your visualizations with others to ensure they communicate effectively.
Summary
- Data visualization is crucial for understanding and interpreting data.
- Common types of visualizations include bar charts, line graphs, pie charts, and histograms.
- Follow best practices to create effective visualizations.
Check your understanding
- What is the primary purpose of data visualization?
- How do you calculate the angle for a slice in a pie chart?
- What is the difference between a bar chart and a histogram?
- List two best practices for creating effective data visualizations.