MathGroup Archive 2001

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

Search the Archive

Re: plot in different colors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27728] Re: plot in different colors
  • From: "David Annetts" <David.Annetts at dem.csiro.au>
  • Date: Tue, 13 Mar 2001 03:52:46 -0500 (EST)
  • References: <98cfmm$fhl@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Robert,

"Robert" <robert.schuerhuber at gmx.at> wrote in message
news:98cfmm$fhl at smc.vnet.net...
> hi!
> if i plot a list of functons, how can i command mathematica to plot each
> function in a different color? i know i can use rgbcolor to change the
> color of the plot, but it is not practical to enter a list of
> rgbcolor[r,g,b] values at each plot. is there an (easy) solution to do
> this more or less automatically?
> regards, robert

For a series of functions (say ftnt = Sin[# Pi t/32] & /@ Range[2, 16]), define
a list of colours (say plots = Hue[#/9] & /@ Range[8];).  Then you can use
    Plot[Evaluate[ftnt], {t, -Pi, Pi}, PlotStyle -> plots];
to plot the functions, each with a different colour.  This trick also works for
MultipelListPlot.

You can probably extend this so that it happens auotmatically using a predefined
lookup table.

Regards,

Dave.

--
-----------------------------------
David Annetts
EM Modelling Analyst
CSIRO DEM
-----------------------------------




  • Prev by Date: Re: Redefine <Shift><Enter> ??
  • Next by Date: Re: How to calculate the area of a polygon?
  • Previous by thread: Re: plot in different colors
  • Next by thread: plot matrix