MathGroup Archive 2000

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

Search the Archive

Re: Coloring multiple graphs differently

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24407] Re: Coloring multiple graphs differently
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 18 Jul 2000 00:58:06 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <8kjclj$dpn@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

> 
> 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.


gr1 = Plot[Sin[x], {x, 0, Pi}, DisplayFunction -> Identity];
gr2 = Plot[Cos[x], {x, 0, Pi}, DisplayFunction -> Identity];

Show[Graphics[
    Transpose[{{RGBColor[1, 0, 0], RGBColor[0, 0, 1]}, First /@ {gr1,
gr2}}], 
    gr1[[2]]], DisplayFunction -> $DisplayFunction]

will show the gr1 graphics in red, gr2 in blue.

DGolber wrote:
> 
> 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.
> 
> Options[Show] just returns {}

I'm not sure if i understand your question,
Options[] return all options for this function. Since Show[] does
nothing than
generate PostScript and send it to the PostScript renderer there is no
aditional
option for Show[]. Show[] use the options to replace the option values
of the
*objects* to show. So you have to ask for Options[Graphics]

 All possible values of a function ? I expect you have not the time to
read all
possible values of of the Sin[] function.

If you mean, "How to optain all possible values for non numeric option
values"
than I agree -- there should be a way to document it.
But this seems hard because Method has different values in NDSolve[],
NIntegrate[], ..

Regards
  Jens


  • Prev by Date: ReadList: Is it really slow?
  • Next by Date: Re: fade to mauve
  • Previous by thread: Re: Coloring multiple graphs differently
  • Next by thread: List of patterns for which a function is defined?