Country: Barbados
You are in the Barbados edition. Type your country to switch.
Nigeria
The Americas
Loading every country…
No country matches. Check the spelling, or choose "Any country" for the Global edition.
You are learning in the Barbados edition, with examples in dollars and from Barbados.
Your learning profile
Financial Data Lab · Lesson 3 of 8
Lab 3: plotting prices and returns
This lab draws the four charts most analysis needs, using matplotlib: a price line, two shares rebased to 100, a histogram of returns and a drawdown chart. It applies the honest-chart rules in code: labelled axes, stated sources and dates, log scales for long periods and no truncated bar axes.
This lesson is complete in writing. A video for it is on its way.
What you will learn
- By the end you can draw a labelled price chart from a pandas table with matplotlib and save it as an image file.
- You can rebase two shares to 100 and compare them fairly on one chart.
- You can choose between a normal and a log scale and explain the choice.
- You can draw a histogram of returns and a drawdown chart, and apply the honest-chart rules to each.
Key terms in this lesson
- Histogram
- A chart that groups values into ranges, or bins, and shows how many fall in each. A histogram of returns shows their spread and tails.
- Step 1: A first price chart, properly labelled, not started
- Step 2: Comparing two shares: rebase to 100, not started
- Step 3: Normal or log scale?, not started
- Step 4: A histogram of returns and a drawdown chart, not started
- Step 5: An honest-chart checklist in code, not started
About 9 min of reading
Step 1 of 5
A first price chart, properly labelled
Opening this step…
Step 2 of 5
Comparing two shares: rebase to 100
This step opens when you finish the one above.
Step 3 of 5
Normal or log scale?
This step opens when you finish the one above.
Step 4 of 5
A histogram of returns and a drawdown chart
This step opens when you finish the one above.
Step 5 of 5
An honest-chart checklist in code
This step opens when you finish the one above.
Key takeaways
The key takeaways open when you finish every step.
Lesson quiz
6 questions. You need 85% to pass.
The quiz opens when you finish every step.
Read first
Stockertim Learn is education. It explains how investing works and never recommends buying or selling anything.
Popular this week: Basics: BeginnerStock market: Intermediate