MathGroup Archive 2012

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

Search the Archive

Re: how to add color legend bar to a ListContourPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124783] Re: how to add color legend bar to a ListContourPlot
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Mon, 6 Feb 2012 02:38:50 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201202010846.DAA15093@smc.vnet.net>

I don't have an IMTEK package. Try reversing the labels in the legend
specification. The legend is then "upside down"; however, it is
correct.

Needs["PlotLegends`"]

xyDat = Table[Sin[i + j^2], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}];

ShowLegend[
 ListContourPlot[xyDat], {ColorData["LakeColors"][1 - #] &, 10, "1", "-1",
  LegendPosition -> {1.1, -.4}}]

ShowLegend[
 ListContourPlot[xyDat], {ColorData["LakeColors"][#] &, 10, "-1", "1",
  LegendPosition -> {1.1, -.4}}]

Alternatively, build your own legend from primitives.


Bob Hanlon



Bob Hanlon


On Fri, Feb 3, 2012 at 2:09 AM, Bob Hanlon <hanlonr357 at gmail.com> wrote:
> Needs["PlotLegends`"]
>
> xyDat = Table[Sin[i + j^2],
>   {i, 0, 3, 0.1}, {j, 0, 3, 0.1}];
>
> ShowLegend[ListContourPlot[xyDat],
>  {ColorData["LakeColors"][1 - #1] &, 10, "1", "-1",
>  LegendPosition -> {1.1, -.4}}]
>
>
> Bob Hanlon
>
>
> On Thu, Feb 2, 2012 at 4:58 AM, Ted Sariyski <tsariysk at craft-tech.com> wrote:
>> Hi,
>> I want to add a color legend to a ListContourPlot. I tried ShowLegend e.g.
>>
>> ShowLegend[ ListContourPlot[xyDat, {ColorData["LakeColors"][#1] &, 10, "
>> 1", "-1"]
>>
>> but I don't know how to make the ColorFunction of ListContourPlot
>> consistent with ColorData of ShowLegend.  Or may be there is a different
>> way of doing this?
>>
>> Any help will be greatly appreciated.
>> Thanks,
>> --Ted
>>



  • Prev by Date: Re: how to add color legend bar to a ListContourPlot
  • Next by Date: Re: Formatting Input cell comments
  • Previous by thread: Re: how to add color legend bar to a ListContourPlot
  • Next by thread: Re: how to add color legend bar to a ListContourPlot