Justin, that is right. "return" caused a graph to be drawn. Now that you pointed out why it didn't work, I see another solution:
graph = complex_plot(g, (-3, 3), (-3, 3)) graph.show() which doesn't require a return statement; since my original intention was to put the drawing command inside a loop and draw a lot of graphs, I'll need to do it with "show" rather than "return". Thank you. Michael On Tuesday, November 13, 2018 at 8:38:52 PM UTC-8, Michael Beeson wrote: > > def nov13(): > var('M,N,z') > f = (M^2-3*N)*(-i *sqrt(3)-1) *z^3 > f = f + (M^2 *(-i *sqrt(3) +3) + 3*N*(-i *sqrt (3) - 1))*z^2 > f = f + (M^2 *(i *sqrt(3)+3) + 3*N* (i* sqrt(3)-1))*z + (M^2-3*N)* (i* > sqrt(3)-1) > g = f.substitute(M=6,N=11) > complex_plot(g, (-3, 3), (-3, 3)) > > if this code is put in a file and the file is "attached" I get no plot, > but if > I paste the function body in to a prompt then I do get a (very nice) plot. > > I expected it would run from an attached file, which is how I usually use > SageMath. > Can someone explain why I don't get a plot that way? > > -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.