【问题标题】:Matplotlib of plotting implicit function (Max{abs(x1),abs(x2)} <= 1)绘制隐函数的Matplotlib (Max{abs(x1),abs(x2)} <= 1)
【发布时间】:2023-02-17 17:26:15
【问题描述】:

如何使用 matplotlib 绘制函数 max{abs(x1),abs(x2)} <= 1 ? 图应该是这样的 enter image description here

我真的不知道。

【问题讨论】:

  • 什么是x1x2x1是不是xx2y

标签: python python-3.x matplotlib math


【解决方案1】:

如果你只想在两个轴上从 -1 到 1 的正方形,那么你可以这样做:

import matplotlib.pyplot as plt

x = [-1, -1, 1, 1]
y = [-1, 1, 1, -1]

plt.plot(x, y)

【讨论】:

    猜你喜欢
    • 2010-10-23
    • 2015-06-04
    • 2012-07-05
    • 1970-01-01
    • 1970-01-01
    • 2012-11-07
    • 2019-09-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多