[Matplotlib-users] sector colouring?

2010-09-27 Thread Piter_
Hi all. Is it possiblle in matplotlib to draw something like this? http://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Integral_example.svg/420px-Integral_example.svg.png Thanks. Petro. -- Start uncovering the many

Re: [Matplotlib-users] sector colouring?

2010-09-27 Thread Joe Kington
Have a look at fill_between: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.fill_between Basically, You'd want something like this: import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, np.pi, 20) y = np.sin(x) plt.figure() plt.fill_between(x, y,