RE: Colors
- To: mathgroup at smc.vnet.net
- Subject: [mg35011] RE: [mg34986] Colors
- From: "DrBob" <majort at cox-internet.com>
- Date: Wed, 19 Jun 2002 05:52:49 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
This illustrates some of what you want to do: <<Graphics`Colors` ClearAll[ReY2] ReY2[f_, {x_, x1_, x2_}, False] := {Plot[f, {x, x1, x2}, PlotStyle -> {{Blue}}, DisplayFunction -> Identity], Plot[Evaluate[f /. x -> -x], {x, -x2, -x1}, PlotStyle -> {{Red}}, DisplayFunction -> Identity]} ReY2[f : {__}, i_, False] := Flatten[ReY2[#, i, False]] & /@ f ReY2[f_, i_] := ReY2[f, i, True] ReY2[f__, True] := Show[ReY2[f, False], DisplayFunction -> $DisplayFunction] ReY2[Sin[t], {t, 0, 4}] ReY2[{Sin[t], Cos[t], t}, {t, 0, 4}] Look at Help examples for Plot, for other ideas. If you use David Park's DrawGraphics package, you can do it this way: Needs["DrawGraphics`DrawingMaster`"] Needs["Graphics`Colors`"] ClearAll[ReY4] ReY4[f_, {x_, x1_, x2_}, False] := {Blue, Draw[f, {x, x1, x2}], Red, Draw[f /. x -> -x, {x, -x2, -x1}]} ReY4[f : {__}, i_, False] := Flatten[ReY4[#, i, False]] & /@ f ReY4[f_, i_] := ReY3[f, i, True] ReY4[f__, True] := Draw2D[ReY4[f, False], Axes -> True] ReY4[Sin[t], {t, 0, 4}] ReY4[{Sin[t], Cos[t], t}, {t, 0, 4}] I suspect David will have a better solution, though. Bobby Treat -----Original Message----- From: Juan Erfá [mailto:erfa11 at hotmail.com] To: mathgroup at smc.vnet.net Subject: [mg35011] [mg34986] Colors Hi,I have the function ReY to reflect a curve about the Y axe: In[4]:= ReY[f_, {x_, x1_, x2_}] := Module[{p, q}, p = Plot[f, {x, x1, x2}, DisplayFunction -> Identity]; q = p /. {u_, v_} -> {-u, v}; Show[p, q, DisplayFunction -> $DisplayFunction]] For ReY[Sin[t],{t,0,4}], I get both functions in black. I would like to use Hue[] to paint the curves in different colors, but after tryng to put Hue[] everywhere I get nothing. Another question is: What I have to do to allow ReY to work with more than one function, I mean: ReY[{Sin[t], t^3, Cos[t], ...},{t, 0,4}]. Finally: How I can paint the axes in other color then black?. Regards.Juan _________________________________________________________________ MSN Photos es la manera más sencilla de compartir e imprimir sus fotos: http://photos.msn.com/support/worldwide.aspx