Re: Coloring multiple graphs differently
- To: mathgroup at smc.vnet.net
- Subject: [mg24426] Re: [mg24369] Coloring multiple graphs differently
- From: BobHanlon at aol.com
- Date: Tue, 18 Jul 2000 00:58:23 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 7/12/2000 11:45:49 PM, dgolber at aol.com writes:
>I have several graphs:
>
>gr1 = Show[
> Plot[...],
> ListPlot[...]
> ]
>
>gr2 = Show[
> Plot[...],
> ListPlot[...]
> ]
>
>To compare these graphs, I display them together:
>
> Show[gr1,gr2]
>
>I want, in this combined display, to have gr1 and gr2 different colors.
>How do I do this? Can I do this?
>
>So far, the definitions of gr1 and gr2 individually do not manipulate colors
>at all. I would like to do the color control only in the line
>
>Show[gr1, gr2]
>
>and not in the individual definitions of gr1 and gr2.
>
>In general, I think the Mathematica documentation in this area is very
>deficient. Suppose I ask, for a given graphics function, "what are all the
>options of this function and what are all the possible values of this
function,
>and what do they do?" Seems like reasonable request, but there is no attempt
>to answer this in any of the documentation I have seen, either on-line
>or the
>4-inch thick book.
>
gr1 = Plot[Sin[x], {x, 0, 4Pi}, DisplayFunction -> Identity];
gr2 = Plot[Cos[x], {x, 0, 4Pi}, DisplayFunction -> Identity];
Show[{gr1 /. Graphics[{x__}, y___] -> Graphics[{RGBColor[1, 0, 0], x}, y],
gr2 /. Graphics[{x__}, y___] -> Graphics[{RGBColor[0, 0, 1], x}, y]},
DisplayFunction -> $DisplayFunction];
Bob Hanlon