Untitled
unknown
plain_text
a year ago
833 B
5
Indexable
import matplotlib.pyplot as plt import numpy as np # Define the price of taxi fare (independent variable) taxi_fare_prices = np.linspace(0, 10, 100) # Define the quantity supplied of buses (dependent variable) quantity_supplied_buses = 100 - 5 * taxi_fare_prices # Create the supply curve for buses plt.plot(taxi_fare_prices, quantity_supplied_buses, label="Supply of Buses", color="b") # Add labels and title plt.xlabel("Price of Taxi Fare") plt.ylabel("Quantity Supplied of Buses") plt.title("Supply of Buses vs. Price of Taxi Fare") plt.grid(True) # Explain the graph plt.annotate( "As taxi fare price increases,\nthe quantity supplied of buses decreases.", xy=(4, 60), xytext=(6, 80), arrowprops=dict(arrowstyle="->", color="r"), fontsize=10, color="r", ) # Show the graph plt.legend() plt.show()
Editor is loading...
Leave a Comment