Saturday, February 27, 2010

complex plot in sage

I've been amusing myself all day with doing some complex plotting in Sage. The default color scheme has 0=black, infinity=white, and red=real. A lot of the time, this doesn't work too well, but if you plot f/abs(f) the color will just depend on the complex argument. For example, if f = (z^5+1)/(z^5-1) we get:



Or a more baroque example, f = z*log(z)*exp((z^5+1)/(z^5-1)^(1/2)):




Sometimes the default coloring is helpful, for example when showing the essential singularity at 0 of exp(1/z):

2 comments:

hsy said...

"infinity loop" - sort of:

f(x) = sin(x) / x^6; complex_plot(f(x)/abs(f(x)), (-4,4),(-2,2), plot_points=200, axes=False, figsize=[10,7])

Anonymous said...

Great post as for me. It would be great to read something more about that topic. The only thing it would also be great to see on this blog is some photos of some gadgets.
Kate Kripke
Cell phone blocker