-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 D. M. Monarres wrote: | Hello all, | | First of all, I would like to thank all of the sage developers. Sage | has been a very useful tool for both graduate work and teaching. | | I have a question about plotting. The plot function allows for a list | of functions as an argument, is there any way that I could specify | the plot colors for each of the curves. For example, when I would | want to talk about graph transformations in lecture I would like to | show the original graph in blue and a scaled graph in red. | | I know about using the + operator with graphs and use that when I am | constructing graphs for myself but when I am in class I think my | students get distracted when there is too much code on the screen. | | What I am thinking about is something like | | | sage: f(x) = x^2 | sage: g(x) = (x-5)^2 | | | sage: plot( [f,g], (x,-10,10), rgbcolor= [ (0,0,1) , (1,0,0) ] ) | | (but I know that this doesn't work. | | Am I missing something obvious? Hi David,
Maybe someone else has a more elegant solution, but here is what I do: sage: f(x) = x^2 sage: g(x) = (x-5)^2 sage: fp = plot(f, (x, -10, 10), rgbcolor = (0,0,1)) sage: gp = plot(g, (x, -10, 10), rgbcolor = (1,0,0)) sage: (fp+gp).show() The plot commands now only create the two plot objects fp and gp, without displaying them. The last line combines them into one plot object and displays it. Best, Alex - -- Alexandru Ghitza Assistant Professor Department of Mathematics Colby College Waterville, ME 04901 http://bayes.colby.edu/~ghitza/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHtyxrdZTaNFFPILgRAstJAKCqaFcGfcOoXWvS0RxfrWnZ/AB1EgCdGuQm +JEV+m3IBKEb/b641Wvfisc= =3BTH -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---