1

I have two arrays of numbers from [-1,1]:

a = 2*np.random.sample(100)-1 and b = 2*np.random.sample(100)-1. These two arrays define the following system of linear inequalities

a[i]*x + b[i]*y <= 1 for i = 0,1,..., 99

The solution-set of this system is a convex polygon. How to draw it using matplotlib? As I understand,fill_between allows to do this only for case of two inequalities.

cheyp
  • 391
  • 2
  • 4
  • 12
  • Please provide the full listing of the code you tried and an example of desired result if possible. – abudis Jul 08 '14 at 01:41

1 Answers1

4

You can use the fillplots package (http://fillplots.readthedocs.org) that does exactly what you are looking for. A few examples are available at http://fillplots.readthedocs.org/en/latest/examples.html.

qfiard
  • 869
  • 8
  • 4
  • Thank you, that's exactly what I wanted. I wonder to know why matplotlib doesn't have such useful function. – cheyp Jul 09 '14 at 19:38