## Graphics in Sage(math)

January 19, 2010 by doxdrum

As you may know, I’m running Sage 4.3 under Ubuntu Karmic.

Yesterday I was trying some basic features of SAGE, say 2D graphics, and I was impressed by its usability.

First I define a function (my first try was)

phi(x) = arctan(x)

and it work. So I move to a function with two variables,

phi(x, s) = 1/s*(arctan(x^s))^s

and try,

phi(x, 1)

and it shows the right expression.

The command

plot(phi(x, 2), (x, -3, 3))

shows me the plot…. and finally I made a loop for plotting the function for a set of odd values of the s-parameter,

for s in range(1,6,2):
plot(phi(x, s), (x, -5, 5))

And it did it!

I tried to do something similar (with much complicated functions, of course) in Mathematica 7, but it has a kernel bug (guess so) for loops of plotting.

### Like this:

Like Loading...

*Related*

## Leave a Reply