Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Filled Plot Example in the Graphics Tour

The code for the Filled Plot Example is as follows:

sage: def f(x):
....:    return RDF(1 / (1 + 25 * x^2))
....: 
sage: def runge():
....:       g = plot(f, -1, 1, rgbcolor='red', thickness=1)
....:     polynom = []
....:     for i, n in enumerate([6, 8, 10, 12]):
....:       data = [(x, f(x)) for x in xsrange(-1, 1, 2 / (n - 1), ...
                include_endpoint=True)]
....:       polynom.append(maxima.lagrange(data).sage())
....:       g += list_plot(data, rgbcolor='black', pointsize=5)
....:     g += plot(polynom, -1, 1, fill=f, fillalpha=0.2, thickness=0)
....:     return g
....: 
sage: runge().show(ymin=0, ymax=1, figsize=(6,4))

What am I supposed to replace the ellipsis with in the definition of runge?