ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 26 Jan 2011 12:11:14 +0100Plotting successive 3D plots in a for loop (only the last one can be plotted!)https://ask.sagemath.org/question/7873/plotting-successive-3d-plots-in-a-for-loop-only-the-last-one-can-be-plotted/Hi,
I have another problem with plotting multiple 3D plots.
When I execute the following two cells in the notebook interface:
Cell 1: (Definition of function that generates parametrized plots)
def plotPerceFL1 (aalpha):
p1_11 = plot3d(Fp1_11(alpha=aalpha),(x,0,1),(y,0,1),color="red")
p1_12 = plot3d(Fp1_12(alpha=aalpha),(x,0,1),(y,0,1),color="gray")
return p1_11+p1_12
Cel 2: (Plotting successive plots for different values of aalpha)
for a in srange(-1,1,step=0.25):
grr=plotPerceFL1(a)
grr.show()
I can see the loop running (if I print a, for example) but nothing is plotted until the end of the loop, then only the last graphic is shown.
Is there any trick to force Sage to successively plotting all graphics (and, preferably, to keep them in the screen one below the other)?
Thanks in advance for your help.
MuratmyildiWed, 26 Jan 2011 12:11:14 +0100https://ask.sagemath.org/question/7873/