Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

RE: RE: Colors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35038] RE: [mg34998] RE: [mg34986] Colors
  • From: "DrBob" <majort at cox-internet.com>
  • Date: Thu, 20 Jun 2002 02:13:59 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Here's a solution that emphasizes the original function a bit more than
the reflection.  It illustrates the nice way various graphics primitives
can be used without confusion, using David Park's DrawGraphics package:

Needs["DrawGraphics`DrawingMaster`"]
ClearAll[ReY5]
ReY5[f_, {x_, x1_, x2_}] := Module[{g},
    Draw2D[
      {Red, Thickness[0.005], g = Draw[f, {x, x1, x2}],
       Blue, Thickness[0.004], g /. DrawingTransform[-#1 &, #2 &]},
      Axes -> True,
      Background -> Bisque
      ]
    ]
ReY5[Sin[t], {t, -2, 3}]
ReY5[{Sin[t], Cos[t]}, {t, -2, 3}]

Bobby Treat

-----Original Message-----
From: David Park [mailto:djmp at earthlink.net] 
To: mathgroup at smc.vnet.net
Subject: [mg35038] [mg34998] RE: [mg34986] Colors

Juan,

This is a question I am going to use to promote the DrawGraphics package at
my web site. DrawGraphics deals directly at the level of primitive graphics
and allows their direct manipulation so it is easier. (The package also
automatically loads the Graphics`Colors` package so we can use color
names
directly.)

This draws three curves for positive t in black and the reflected curves in
Red. DrawingTransform just implements the rule you used, but also works
properly with the various graphic primitives such as Text.

Needs["DrawGraphics`DrawingMaster`"]

Draw2D[
    {g = Draw[{Sin[t], t^3, Cos[t]}, {t, 0, 4}],
      Red, g /. DrawingTransform[-#1 &, #2 &]},
    Axes -> True];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

> From: Juan Erfá [mailto:erfa11 at hotmail.com]
To: mathgroup at smc.vnet.net
>
> 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
>






  • Prev by Date: RE: Friendly Challenge 2: sort by column
  • Next by Date: RE: Re: RE: Experimental`FileBrowse
  • Previous by thread: RE: Colors
  • Next by thread: Colors