On Sunday, November 3, 2013 2:22:05 AM UTC-8, projetmbc wrote:
>
> Hello,
> here is a way to draw several functions on the same graphic.
>
> ----------------------------------------------------
> myFamily = plot(0, x, 1, 7)
>
> for a in range(1, 10):
> myFamily += plot(a*x^2+2, x, 1, 7)
>
> show(myFamily)
> ----------------------------------------------------
>
> I find this simple but a little ugly because I use plot(0, x, 1, 7)
> that indeed is not in my family of functions.
>
You can initialize with an empty graphics object instead:
myFamily = Graphics()
> Is there a better way ? Just a precision : here I use a simple
> family of functions but I'm looking for a kind of stack functionality
> for plotting functions.
>
I don't know what you mean with "stack". Do you want to plot the partial
sums of your sequences of functions?
G = Graphics(); f = 0
for a in range(1,10):
f += sin(a*x)+1
G += plot(f,x,-4,4,color=(a/10.0,(1-a)/10.0,0))
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.