我有两个来自 [-1,1] 的数字数组:
a = 2*np.random.sample(100)-1
和
b = 2*np.random.sample(100)-1
。这两个数组定义了以下线性不等式系统
a[i]*x + b[i]*y <= 1 对于 i = 0,1,..., 99
该系统的解集是一个凸多边形。如何使用 matplotlib 绘制它?据我了解,fill_between
仅允许在两个不等式的情况下这样做。
我有两个来自 [-1,1] 的数字数组:
a = 2*np.random.sample(100)-1
和
b = 2*np.random.sample(100)-1
。这两个数组定义了以下线性不等式系统
a[i]*x + b[i]*y <= 1 对于 i = 0,1,..., 99
该系统的解集是一个凸多边形。如何使用 matplotlib 绘制它?据我了解,fill_between
仅允许在两个不等式的情况下这样做。
您可以使用 fillplots 包 ( http://fillplots.readthedocs.org ) 来满足您的需求。http://fillplots.readthedocs.org/en/latest/examples.html提供了一些示例。