I am still getting familiar with the matplotlib library and I'm encountering a problem I've never had before. My intention is to graph the relative error associated with the scipy.integrate.quadrature method as a function of its tolerance value. What I'm encountering when I plot it, however, are two distinct lines from the same plt.plot command. How did this happen? I'll put my code in below.
from scipy import integrate
def f(x):<br/>
return np.sqrt(1 - x**2)<br/>
xlist = []<br/>
for i in range (-12, 0):<br/>
xlist.append(i)<br/>
tolerancelist = []<br/>
for i in xlist:<br/>
tolerancelist.append(10**i)<br/>
ylist = []<br/>
for i in tolerancelist:<br/>
q = integrate.quadrature(f, -1, 1, tol=i)<br/>
ylist.append(q)<br/>
plt.plot(tolerancelist, ylist, label='line1')<br/>
legend = plt.legend(loc='best')