1 | initial version |
I don't think it's possible to take a single function and plot it with different colors. You could of course add a bunch of plots of the different pieces as separate functions. You might find the rainbow()
function very useful for this, try
sage: rainbow?
for more information.
Or are you asking for this option as an enhancement request? Given your interest and username, I highly suggest you ask for an account at our Trac server (instructions there) and add this to the ticket for improving piecewise plotting. It would be a great way to start getting involved in the Sage community!