xi = quad.GaussLobattoJacobi(4).nodes

"""
Explanation: The coordinates of solution points using Gauss-Lobatto-Legendre quadrature points.
End of explanation
"""


Lk = poly.LagrangeBasis(xi)

"""
Explanation: The Lagrange basis using the Gauss-Lobatto-Legendre quadrature points.
End of explanation
"""


x = numpy.linspace(-1., 1., 100)
phi = Lk(x)

pyplot.figure(figsize=(6, 3))
pyplot.plot(x, phi[:, 0], 'r-', lw=3, label="1st basis")
pyplot.plot(x, phi[:, 1], 'm-', lw=3, label="2nd basis")
pyplot.plot(x, phi[:, 2], 'c-', lw=3, label="3rd basis")
pyplot.plot(x, phi[:, 3], 'g-', lw=3, label="4th basis")
pyplot.plot(xi, numpy.zeros(4), 'k.--', lw=2, 
            markersize=15, markerfacecolor='r', markeredgecolor='r')
pyplot.plot(xi, numpy.ones(4), 'k.--', lw=2, 
            markersize=15, markerfacecolor='r', markeredgecolor='r')
pyplot.ylim(-0.2, 1.05)
pyplot.title(r'$\eta(\xi)$', fontsize=25)
pyplot.xlabel(r'$\xi$', fontsize=15)
pyplot.grid()
pyplot.legend(loc=0, bbox_to_anchor=(1.02, 1.04));

"""
Explanation: This is used to plotting the basis functions.
End of explanation
"""


