需求曲线有两种形式

需求曲线有两种形式

1.一种是需求随着价格上涨而下降

import matplotlib.pyplot as plt

# 定义需求函数
def demand_function(price):
  return 100 - price

# 创建数据点
prices = range(0, 101)
demands = [demand_function(price) for price in prices]

# 绘制需求曲线
plt.plot(prices, demands)
plt.xlabel("Price")
plt.ylabel("Demand")
plt.show()

image

2.一种是需求随着价格上涨而上涨

import matplotlib.pyplot as plt

# 定义数据
x = [1, 2, 3, 4, 5]
y = [6, 7, 8, 9, 10]

# 创建图表
plt.plot(x, y)

# 显示图表
plt.show()

image

posted @   ukyo--碳水化合物  阅读(28)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2019-12-01 String数组转int数组
主题色彩
人是要整活的——没活了,可不就是死了么?
点击右上角即可分享
微信分享提示