MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Colors

This illustrates some of what you want to do:

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:

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] 
To: mathgroup at
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
tryng to put Hue[] everywhere I get nothing.

Another question is: What I have to do to allow ReY to work with more
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?.


MSN Photos es la manera más sencilla de compartir e imprimir sus fotos:

  • Prev by Date: Re: RE: Experimental`FileBrowse
  • Next by Date: Re: RE: Trace a function
  • Previous by thread: RE: Colors
  • Next by thread: RE: Colors