Untitled
unknown
plain_text
12 days ago
948 B
2
Indexable
Never
import matplotlib.pyplot as plt import numpy as np # Leisure hours range from 0 to 24 L = np.linspace(0, 24, 100) # Calculate income based on leisure hours I = 360 - 15 * L # Create the plot plt.figure(figsize=(10, 6)) # Opportunity Set plt.plot(L, I, label='Opportunity Set', color='blue') plt.fill_between(L, I, color='lightblue', alpha=0.5) # MRS line (willing to give up $11 for leisure) MRS_income = np.linspace(0, 360, 100) MRS_leisure = (360 - MRS_income) / 15 # Inverse of the income equation plt.plot(MRS_leisure, MRS_income, label='MRS (Income given up for Leisure)', color='red', linestyle='--') # Axes settings plt.xlim(0, 24) plt.ylim(0, 360) plt.title('Opportunity Set: Leisure vs. Income with MRS') plt.xlabel('Leisure Hours (L)') plt.ylabel('Income (I in $)') plt.axhline(0, color='black', lw=0.5, ls='--') plt.axvline(0, color='black', lw=0.5, ls='--') plt.grid() plt.legend() plt.show()
Leave a Comment