Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: ListDensityPlot how to define colors for specific range of values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100660] Re: ListDensityPlot how to define colors for specific range of values
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Wed, 10 Jun 2009 17:10:37 -0400 (EDT)
  • References: <h0nuls$bei$1@smc.vnet.net>

Dear prageeth,

All you have to do is to define a function that returns a color given
the z-value as argument (or a value between 0 and 1, depending on the
setting of the option ColorFunctionScaling)

For example (with the default ColorFunctionScaling->True):

Continuous blend:

DensityPlot[Sin[x y], {x, -3, 3}, {y, -3, 3},
 ColorFunction -> (Blend[{Red, White, Blue}, #] &), PlotPoints -> 100]

Dicrete colours:

DensityPlot[Sin[x y], {x, -3, 3}, {y, -3, 3},
 ColorFunction -> (\[Piecewise] {
      {White, # < 0.1},
      {Red, 0.1 <= # <= 0.5},
      {Blue, 0.5 < # < 0.8},
      {Green, 0.8 <= #}
     } &), PlotPoints -> 100]


Cheers -- Sjoerd


On Jun 10, 11:33 am, prageeth saraka wimalaweera
<pswimalawe... at gmail.com> wrote:
> Dear friends,i want to use ListDensityPlot to represent my list of data.how
> can i define specific color for specific range of values? is there any way
> to  define this in Mathamatica? your comments are highly appreciated .
> Thank you
>
> prageeth
>
> --
> Software Engineer,
> Axiohelix Co,
> Okinawa Industry Support Center 1831-1 Oroku,
> Naha-shi,
> Okinawa,
> 901-0152 Japan.



  • Prev by Date: Re: What should be a simple task....
  • Next by Date: Re: What should be a simple task....
  • Previous by thread: Re: ListDensityPlot how to define colors for specific range of values
  • Next by thread: AnimationDirection when Exporting