Ask Your Question
0

Filled Plot Example in the Graphics Tour

asked 2011-09-25 15:53:09 +0100

Doctor Pi gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-09-25 17:35:37 +0100

Dirk Danckaert gravatar image

My guess: nothing. It's meant as a line continuation indication. Omit the ellipsis and continue with 'include...', right behind the comma. Type 'xsrange?' for help with the syntax of the xsrange() command.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-09-25 15:53:09 +0100

Seen: 457 times

Last updated: Sep 25 '11