C. What Are Data and Visualization?
๐ฏ Learning Goals
By the end of this lesson, you'll be able to:
- โ You understand what data and visualization are
- โ You can explain why we need graphs
- โ You can draw a simple line with the turtle
Core Concepts
What Are Data and Visualization?
data and visualizationis turning numbers into pictures!
๐ Analogy: Report Card vs. Graph
- As numbers: Korean 85, Math 92, English 78, Science 88
- As a graph: You can see at a glance that Math is the highest!
Numbers alone are hard to compare, but with a graph you can understand right away !
Why Do We Need Visualization?
| Situation | Numbers only | With a graph |
|---|---|---|
| Comparing scores | You have to figure out which subject is higher | Compare instantly by bar height |
| Trend over time | You have to read the numbers one by one | Grasp it instantly from the slope of the line |
| Checking proportions | You need to calculate percentages | Check it instantly with a pie graph |
See Example Graphs
Let's see what a real graph looks like! Press the Run button.
๐ Bar Graph (Bar Chart)
Used to compare sizes across categories!
Advantages of bar graphs
At a glance, you can see that Math is the highest, and English is the lowest!
๐ Line Graph (Line Chart)
Used to see changes over time!
Advantages of line graphs
You can see at a glance that the temperature keeps rising from January to June!
๐ฅง Pie Graph (Pie Chart)
Used to see the proportion of the whole!
Advantages of pie graphs
Apples make up 35% of the totalโyou can tell right away that they're the most popular!
Types of Graphs
| Graph type | Use |
|---|---|
| ๐ Bar graph | Comparing sizes |
| ๐ Line graph | Trend over time |
| ๐ฅง Pie graph | Showing proportions |
| ๐บ๏ธ Other | Maps, heatmaps, etc. |
Try Visual Coding
Let's draw a simple line with the turtle. This is the foundation of a graph!
# Add blocks and the Python code will show up here...
Example Code
import turtle
t = turtle.Turtle()
t.shape("turtle")
# Draw a simple horizontal line - the foundation of a graph!
t.forward(200)
What Happens
The turtle draws a line to the right. This line becomes the foundation of a bar graph!
โ ๏ธ Try Breaking It (Let's Break It!)
Look at the data below. Which graph would be best?
| Mon | Sales |
|---|---|
| Jan | 100 |
| Feb | 120 |
| Mar | 90 |
| Apr | 150 |
Choices
- A) Pie graph
- B) Line graph
- C) Bar graph
Show Answer
B) Line graphis the best fit!
| Data characteristics | Best graph |
|---|---|
| Used to see changes over time | Line graph ๐ |
| Comparison across categories | Bar graph ๐ |
| Proportion of the whole | Pie graph ๐ฅง |
Monthly sales are data that show Used to see changes over time, so a line graph that shows the trend well is the best fit!
๐ฏ Quiz
Show Answer
Answer: C) Pie graph (showing proportions)
When showing "proportions," a pie graph is the best fit! It treats the whole as 100%, so you can see at a glance the share each part takes up.
- Line graph: change over time
- Bar graph: by category Size Comparison
- Pie graph: relative to the whole Proportion
Fill-in-the-Blank Practice
Data and visualization and graph types:
- Data and visualization turn numbers into pictures
- Change over time: a graph
- Proportion of the whole: a graph
- Comparison across categories: a graph
Try Coding It Yourself
Draw a Plus Shape
Draw a plus (+) shape with the turtle. It's like the X-axis and Y-axis of a graph!
Example Answer
import turtle
t = turtle.Turtle()
t.shape('turtle')
# Horizontal line
t.forward(100)
t.backward(200)
t.forward(100)
# Vertical line
t.left(90)
t.forward(100)
t.backward(200)
Result: A plus shape is drawn! These are the axes of a graph.
๐งฉ Key Takeaways
What you learned in this lesson:
| Concept | Description |
|---|---|
| data and visualization | Turning numbers into pictures |
| Advantages | You can understand information at a glance |
| Graph type | Bar, line, pie graphs, etc. |
| Using the turtle | Make a graph by drawing lines |
Review Checklist
- [ ] Can you explain what data and visualization are?
- [ ] Do you know why graphs are better than numbers?
- [ ] Can you draw a line with the turtle?