Untitled

 avatar
unknown
plain_text
a month ago
1.5 kB
4
Indexable
import matplotlib.pyplot as plt
import numpy as np

# Define price (P) and quantity (Q) values
Q = np.linspace(0, 100, 100)

# Original supply and demand curves
S1 = 0.5 * Q + 20   # Original supply curve
D1 = 100 - Q        # Original demand curve

# New demand curve (shifted right)
D2 = 120 - Q        # Increased demand for bacon burgers

# New supply curve (shifted right, producers increase supply)
S2 = 0.5 * Q + 25   # Increased supply curve

# Create the plot
plt.figure(figsize=(8, 6))

# Plot the curves
plt.plot(Q, S1, label="Original Supply (S1)", color='blue', linestyle='--')
plt.plot(Q, D1, label="Original Demand (D1)", color='red')
plt.plot(Q, D2, label="New Demand (D2)", color='orange', linestyle='--')
plt.plot(Q, S2, label="New Supply (S2)", color='green')

# Labeling the graph
plt.title("Market for Pork Bellies (1995) - Price Adjustment")
plt.xlabel("Quantity of Pork Bellies")
plt.ylabel("Price of Pork Bellies")

# Marking the Equilibrium Points
plt.plot(40, 60, 'bo')  # E1 - Original equilibrium
plt.text(40, 60, "  E1", verticalalignment='bottom', horizontalalignment='right')

plt.plot(50, 55, 'go')  # E2 - New equilibrium
plt.text(50, 55, "  E2", verticalalignment='bottom', horizontalalignment='right')

plt.plot(60, 50, 'mo')  # E3 - New equilibrium after increased supply
plt.text(60, 50, "  E3", verticalalignment='bottom', horizontalalignment='right')

# Add a legend
plt.legend()

# Show the plot
plt.grid(True)
plt.show()
Leave a Comment