In [4]:
import numpy as np
from sympy import *
import matplotlib.pyplot as plt
%matplotlib inline
x = symbols('x')
f = lambda x: sqrt(1-x**2)
fig = plt.gcf()
fig.set_size_inches(12,6)
xs = np.linspace(-1,1,200)
ys = np.array([f(x) for x in xs],dtype='float')
plt.grid(True)
plt.xlabel('X')
plt.ylabel('Y')
plt.fill_between(xs,ys,0,color='#004000',alpha=0.2)
Out[4]:
<matplotlib.collections.PolyCollection at 0x3e905d0>