【问题标题】:Plot the solution of a system of linear inequalities绘制线性不等式系统的解
【发布时间】:2014-07-07 22:18:35
【问题描述】:

我有两个来自 [-1,1] 的数字数组:

a = 2*np.random.sample(100)-1b = 2*np.random.sample(100)-1。这两个数组定义了以下线性不等式系统

a[i]*x + b[i]*y

这个系统的解集是一个凸多边形。如何使用 matplotlib 绘制它?据我了解,fill_between 只允许在两个不等式的情况下这样做。

【问题讨论】:

  • 如果可能,请提供您尝试过的代码的完整列表以及所需结果的示例。

标签: python matplotlib convex-polygon


【解决方案1】:

您可以使用 fillplots 包 (http://fillplots.readthedocs.org) 来满足您的需求。 http://fillplots.readthedocs.org/en/latest/examples.html 提供了一些示例。

【讨论】:

  • 谢谢,这正是我想要的。我想知道为什么matplotlib没有这么有用的功能。
猜你喜欢
  • 2015-01-02
  • 2017-03-09
  • 2021-06-20
  • 1970-01-01
  • 2013-07-08
  • 2022-12-08
  • 1970-01-01
  • 2017-12-13
  • 1970-01-01
相关资源
最近更新 更多