Sub topic 5
Drawing the demand curve
This chapter assumes you have read the earlier chapters on quantity demanded, ceteris paribus, the law of demand, and the demand schedule. It also assumes you can graph a straight line from an equation. Here you turn a demand schedule into a picture, learn to read that picture, and learn the mistakes people most often make when drawing it.
From schedule to points
A demand schedule is a table with two columns: a price, and the quantity demanded at that price. Each row is one fact: "If the price is $20, buyers want to buy 60 units per week." The demand curve is that table drawn on a graph.
Each row becomes one point. The price gives the point's height. The quantity gives its distance from the left edge. Connect the points and you have the curve.
Use the schedule generated by the linear demand function Q = 100 − 2P:
| Price ($) | Quantity demanded (units per week) |
|---|---|
| 0 | 100 |
| 10 | 80 |
| 20 | 60 |
| 30 | 40 |
| 40 | 20 |
| 50 | 0 |
You can generate this table directly:
def quantity_demanded(price, a=100, b=2):
"""Linear demand: Q = a - b * P, never below zero."""
return max(a - b * price, 0)
print("Price Quantity")
for p in range(0, 51, 10):
print(f"{p:>5} {quantity_demanded(p):>8}")
# Output:
# Price Quantity
# 0 100
# 10 80
# 20 60
# 30 40
# 40 20
# 50 0The max(..., 0) matters. A buyer cannot demand a negative quantity, so the function stops at zero. On the graph, this is where the curve meets the horizontal axis.
The axis convention
Economics puts price on the vertical axis and quantity on the horizontal axis. This is a historical convention, and it looks odd because price is the cause and quantity is the response. In most other fields the cause goes on the horizontal axis. Learn the economics convention, because every later graph in microeconomics uses it.
This has a consequence for equations. The demand function Q = 100 − 2P gives quantity as a function of price, but the graph has price on the vertical axis. To describe the curve as a line "y = something in x", solve for P:
- Start with Q = 100 − 2P.
- Move the price term: 2P = 100 − Q.
- Divide by 2: P = 50 − 0.5Q.
The result, P = 50 − 0.5Q, is called the inverse demand function. It is the same relationship written the other way round. Use the original form to ask "how much will be bought at this price?" Use the inverse form to ask "what is the highest price at which buyers will take this quantity?"
Plotting the curve step by step
- Draw two axes. Label the vertical axis "Price ($ per unit)" and the horizontal axis "Quantity demanded (units per week)". Include the units and the time period.
- Choose scales that cover every row of the schedule, starting at zero.
- For each row, find the price on the vertical axis and the quantity on the horizontal axis. Mark the point where they meet.
- Connect the points with a smooth line.
- Label the curve D.
The same steps in Python, using the inverse demand function to compute prices:
import matplotlib.pyplot as plt
def price_at(quantity, a=100, b=2):
"""Inverse demand: P = (a - Q) / b."""
return (a - quantity) / b
quantities = list(range(0, 101, 10))
prices = [price_at(q) for q in quantities]
fig, ax = plt.subplots()
ax.plot(quantities, prices, marker="o", label="D")
ax.set_xlabel("Quantity demanded (units per week)")
ax.set_ylabel("Price ($ per unit)")
ax.set_xlim(0, 110)
ax.set_ylim(0, 55)
ax.legend()
fig.savefig("demand_curve.png")
print("saved demand_curve.png")
# Output:
# saved demand_curve.pngThe code needs the matplotlib package. It saves the figure to a file, so it also works on a machine with no display.
The diagram below shows the same curve. The vertical axis is price. The horizontal axis is quantity.
Reading the curve
A demand curve carries information in several ways.
Reading across and down
To find the quantity demanded at a price, start on the vertical axis at that price. Move horizontally to the curve, then drop straight down to the horizontal axis. At a price of $20, you reach the curve at a quantity of 60.
To go the other way, start at a quantity and move up to the curve, then across. This gives the highest price at which buyers will take that quantity. For 40 units it is $30.
The two intercepts
- The vertical intercept is the price at which quantity demanded falls to zero. Here it is $50. Economists call this the choke price: any price at or above it drives all buyers away. In the inverse function, P = 50 − 0.5Q, it is the constant term.
- The horizontal intercept is the quantity demanded at a price of zero. Here it is 100 units. This is the amount buyers would take if the good were free. It is a useful anchor for drawing the line, but real free goods are often limited by something other than price, such as time or storage.
Height as willingness to pay
You can also read the curve's height as willingness to pay. At Q = 40 the curve is at $30. Buyers would pay up to $30 for the 40th unit, and a price above $30 would leave them at fewer than 40 units. Later chapters use this reading to define consumer surplus.
The slope of the picture
The slope of a line on a graph is rise over run: the change in the vertical variable divided by the change in the horizontal variable. On a demand graph, the vertical variable is price and the horizontal one is quantity.
For this curve, moving from (0, 50) to (100, 0) gives a rise of −50 over a run of 100. The graphed slope is −0.5. That matches the coefficient in P = 50 − 0.5Q.
Compare it with the demand function Q = 100 − 2P, where the coefficient on P is −2. The two numbers are not the same. They are reciprocals:
a, b = 100, 2
slope_q_on_p = -b # change in quantity per $1 change in price
slope_on_graph = -1 / b # change in price per 1-unit change in quantity
print(slope_q_on_p)
print(slope_on_graph)
# Output:
# -2
# -0.5Every slope here is negative. That is the law of demand showing up in the picture: a higher price goes with a smaller quantity, so the line falls from left to right.
Straight lines and curves
The name "curve" is used even when the line is straight. A straight line is a linear demand curve, and it is the easiest to draw and analyze. Real demand is often not linear. A function such as Q = 200/P gives a bowed shape that gets closer to each axis without touching it.
The two shapes share the property that matters here: they slope downward. Whether the line is straight or bowed depends on how buyers respond across the whole range of prices. The law of demand fixes only the direction.
Common errors
Swapping the axes
Putting quantity on the vertical axis is the most frequent error. The curve still slopes downward, so the mistake can go unnoticed, but the slope, intercepts, and later graphs (supply, equilibrium, surplus) will all be wrong. Always label axes before you plot.
Reading the curve as a record of events
The curve does not show what happened over time as the price changed. It is a set of what-if statements: "if the price were this, buyers would want that much." Each point is a separate hypothetical, and all of them describe the same moment. This is the ceteris paribus condition at work. The curve holds income, tastes, related prices, expectations, and the number of buyers fixed.
Drawing past the data
A linear function extended too far gives nonsense. If you plot Q = 100 − 2P for P = 60 without the max(..., 0) cut-off, you get a quantity of −20. The curve stops at the horizontal axis, and so does the graph. The same caution applies at high quantities: the horizontal intercept is where the formula says the price is zero, and you should not extend the line beyond it.
Forgetting the time period
"Quantity demanded is 60" is incomplete. Sixty per week and sixty per year describe very different markets. Always state the period on the axis label.
Mixing up moving along the curve and shifting it
If the price of this good changes, you move to a different point on the same curve. If something else changes, such as income, the whole curve moves. The next chapters treat this distinction in full. For now, remember that a price change never moves the curve itself.
Checking your drawing
Before you trust a hand-drawn or coded curve, run a short check:
- Pick two prices from the schedule and confirm that both points lie on the line.
- Check that the vertical intercept equals a/b and the horizontal intercept equals a.
- Confirm that raising the price moves you up and to the left.
For the example, a/b = 100/2 = 50 and a = 100, which match the graph.
Exercise
A good has the demand function Q = 80 − 4P, where Q is units per week and P is dollars. (a) Write the inverse demand function. (b) Find the vertical and horizontal intercepts. (c) What is the slope of the curve as drawn, with price on the vertical axis?
Show answer
(a) Solve for P: 4P = 80 − Q, so P = 20 − 0.25Q. (b) The vertical intercept is P = 20, found by setting Q = 0. The horizontal intercept is Q = 80, found by setting P = 0. (c) The drawn slope is −0.25, the reciprocal of the coefficient −4 in the original function.
Exercise
Using the curve Q = 100 − 2P from this chapter, the price falls from $30 to $20. Describe what happens in the picture, and say whether the curve moves.
Show answer
The point moves down the curve from (Q = 40, P = 30) to (Q = 60, P = 20). Quantity demanded rises by 20 units. The curve does not move, because only the good's own price changed, and a price change shows up as movement along the curve.
Exercise
A student plots the schedule for Q = 100 − 2P with quantity on the vertical axis and price on the horizontal axis. The line still slopes downward. Name two things that are now wrong, and explain why the error is easy to miss.
Show answer
The slope and the intercepts are read from the wrong axes, so the drawn slope is −2 instead of −0.5, and the "choke price" would be read as 100 units on the wrong axis. Later graphs that combine demand with supply will also not line up. The error is easy to miss because any downward-sloping line looks like a plausible demand curve, so the shape does not reveal that the axes are swapped.