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

MathGroup Archive 2010

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

Search the Archive

Re: color legend

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110497] Re: color legend
  • From: "Kevin J. McCann" <kjm at KevinMcCann.com>
  • Date: Mon, 21 Jun 2010 02:11:30 -0400 (EDT)
  • References: <hvkh2a$qeb$1@smc.vnet.net>

Bob,

The problem I have with this approach is that you have to give, in text, 
the min and max labels for the plot. This is clearly a place where 
errors can occur. It would be really great if all you had to do was to 
specify the min and max of the z-axis (color scale) and the legend 
automatically incorporated this.

Kevin

Bob Hanlon wrote:
> Needs["PlotLegends`"]
> 
> ShowLegend[
>  ArrayPlot[
>   Table[5./(1 + x^2 + y^2),
>    {x, -5, 5}, {y, -5, 5}],
>   Frame -> None,
>   ColorFunction ->
>    Function[{a},
>     RGBColor[1 - a, 1 - a, 1 - a]]],
>  {Function[{a},
>    RGBColor[a, a, a]],
>   11, " 5", " 0",
>   LegendPosition -> {1.1, -0.4}}]
> 
> 
> Bob Hanlon
> 
> ---- eric g <eric.phys at gmail.com> wrote: 
> 
> =============
> Hello Group,
> I want to add a color grayscale 
> (myColorFunction[x_]:=RGBColor[1-x,1-x,1-x]) legend this arrayplot, from 
> min (white) to max (dark) values.
> 
> ArrayPlot[Table[5./(1 + x^2 + y^2), {x, -5, 5}, {y, -5, 5}], Frame -> None]
> 
> best regards,
> eric
> 
> 


  • Prev by Date: Help me : Solve a simple PDE in Mathematica
  • Next by Date: Re: Book?
  • Previous by thread: Re: color legend
  • Next by thread: Re: color legend