MathGroup Archive 2011

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

Search the Archive

Re: ListDensityPlot and Legend

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120819] Re: ListDensityPlot and Legend
  • From: Jacopo Bertolotti <jacopo.bertolotti at gmail.com>
  • Date: Thu, 11 Aug 2011 07:55:00 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201108110909.FAA07147@smc.vnet.net>

If I understand correctly what you want to do you have to evaluate the 
maximum and the minimum of your data and pass it to ShowLegend as 
strings via the function ToString.
Try working on this example:

Needs["PlotLegends`"]
data = Table[Sin[j^2 + i], {i, 0, Pi, Pi/5}, {j, 0, Pi, Pi/5}];
min = N@Min[data];
max = N@Max[data];
ShowLegend[ ListDensityPlot[data, InterpolationOrder -> 3], 
{ColorData["LakeColors"][1 - #1] &, 10, ToString[max], ToString[min], 
LegendPosition -> {1.1, -.4}, LegendShadow -> None}]

bye

Jacopo

On 08/11/2011 11:09 AM, math_new wrote:
> Hi,
>
> how can I create a color bar as a Legend such that the numbers at the
> legend really correspond to the highest/lowest value in the Plot. I
> don't understand the examples in the Documentation Center for Legend
> and ShowLegend.
>
> Cheers
>
>





  • Prev by Date: FunctionInterpolation and NIntegrate
  • Next by Date: Re: How does Clear["Global`*"] work?
  • Previous by thread: ListDensityPlot and Legend
  • Next by thread: How does Clear["Global`*"] work?