Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8360

Re: how to add color legend bar to a ListContourPlot

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: how to add color legend bar to a ListContourPlot
Date 2012-02-06 07:46 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jgo0g6$a38$1@smc.vnet.net> (permalink)
References <201202010846.DAA15093@smc.vnet.net>

Show all headers | View raw


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@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@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
>>

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: how to add color legend bar to a ListContourPlot Bob Hanlon <hanlonr357@gmail.com> - 2012-02-06 07:46 +0000
  Re: how to add color legend bar to a ListContourPlot David Skulsky <edskulsky@gmail.com> - 2012-02-07 09:06 +0000

csiph-web