【发布时间】:2023-02-17 17:26:15
【问题描述】:
如何使用 matplotlib 绘制函数 max{abs(x1),abs(x2)} <= 1 ? 图应该是这样的 enter image description here
我真的不知道。
【问题讨论】:
-
什么是
x1和x2?x1是不是x,x2是y?
标签: python python-3.x matplotlib math
如何使用 matplotlib 绘制函数 max{abs(x1),abs(x2)} <= 1 ? 图应该是这样的 enter image description here
我真的不知道。
【问题讨论】:
x1和x2? x1是不是x,x2是y?
标签: python python-3.x matplotlib math
如果你只想在两个轴上从 -1 到 1 的正方形,那么你可以这样做:
import matplotlib.pyplot as plt
x = [-1, -1, 1, 1]
y = [-1, 1, 1, -1]
plt.plot(x, y)
【讨论】: