Combining plots with SAGE

May 15th, 2009 | Categories: math software, sage interactions | Tags:

SAGE math is probably the best open-source maths package out there at the moment and slowly but surely I have been learning some of its tricks.  Combining 2D Plots is particularly easy for example.  Let’s plot a cosine curve in red

p1=plot(cos(x),x,-6,6,rgbcolor='red')
show(p1)

Cosine curve plotted with SAGE math

Now let’s plot a sine curve in green

p2=plot(sin(x),x,-6,6,rgbcolor='green')
show(p2)

Sine curve plotted with SAGE math

Combining these two plots into one single plot is extremely intuitive – just add them together

show(p1+p2)

Combined Sine/Cosine curves plotted with SAGE math

You don’t get much easier than that.  Powerful, easy to use and free – loving it!

No comments yet.