Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello, @thetha. The problem is that

plotlist = [f.plot((x, 1, 10)) for f in funclist]

defines a list of Sage plots. You can verify this by writing


You should get:

<type 'list'>
<class ''>

What you need is just one Sage plot, i.e., a <class ''>, like any of the plotlist[i].

The solution is the following:

funclist = [1/x^i for i in range(10)]
plotlist = sum(f.plot((x, 1, 10)) for f in funclist)

This way, instead of creating a list of plot, you sum all the plots together, which is equivalent to superimpose them in a single image. You can verify this by typing again:


(This time you will get <class ''>, as desired.)

The result should look like this: image description