On Fri, Jan 30, 2009 at 3:32 PM, bizoid <justin.b...@gmail.com> wrote: > > Sage Support: > > I am a new Sage user and I have a question regarding the plot function > in Notebook. > > Below is a little snippet of code I wrote to plot the Bessel_J > function for various nu on different intervals. The snippet below is > just an exercise in learning python and its plot function. > > I have one question: > > Question #1: > > In line 4 of the code below, I assign P = plot(....). I do this > because the P += plot(....) will not work unless P has been previously > assigned. How do I assign P an empty plot "object" so line 4 is > unnecessary and line 5 works? > > - - - - - Code - - - - - - > > 1 def plot_Bessel_J(nu, z): > 2 for m in range(0,nu): > 3 if m == 0: > 4 P = plot(lambda y:bessel_J(m, y), (1, z)) # > Question 1 is in regards to this line > 5 P += plot(lambda y:bessel_J(m, y),(1, z)) > 6 P.show() > 7 > 8 plot_Bessel_J(0,10) > > Thank you in advance for any help that you provide.
Do P = Graphics() William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---