Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using colormaps for several curves in a single plot (lists)

I would like to plot in a simgle fingure several curves, with the colors changing according to a colormap. More precisely, I want to plot some partial sums of a power series, and would like to use the "Blues" colormap to do this. I am using lists to produce the figures / functions. I can actually do something reasonable with color =(?,?,?), but want to be able to use the colormaps. Here is what I got :

Terms = [x^(2+j)*(2+(-1)^(j+1)) for j in range(10)]
Sums = [sum(Terms[0:n]) for n in range(10)]
Figures = [plot(Sums[j], (x,-1.2,1.2), ymin=-3, ymax = 3, color= (0,1-j/10,j/10)) for j in range(10)]
show(sum(Figures))