MathGroup Archive 2007

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

Search the Archive

Show legend and location of data points in ListContourPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80305] Show legend and location of data points in ListContourPlot
  • From: Claus <Clausenator at gmail.com>
  • Date: Fri, 17 Aug 2007 01:47:03 -0400 (EDT)

Hi,
I want to show a legend and the location of data points in a
ListContourPlot.

I can show the locations with:
plt1 = ListPlot[Transpose[{xVal, yVal}], Frame -> False,
   PlotRange -> Automatic, AspectRatio -> 1, DataRange -> Automatic];
plt2 = ListContourPlot[Transpose[{xVal, yVal, uVal}],
   PlotRange -> Automatic, AspectRatio -> 1, DataRange -> Automatic];
Show[plt2, plt1]

What is the best way to add a legend?
I came up with this, but the both plots don't match:
plt1 = ShowLegend[
   ListPlot[Transpose[{xVal, yVal}], Frame -> False,
    PlotRange -> Automatic, AspectRatio -> 1,
    DataRange -> Automatic], {ColorData["LakeColors"][1 - #1] &, 10,
    MaxU, " " <> MinU, LegendPosition -> {1.1, -.4}}];
plt2 = ShowLegend[
   ListContourPlot[Transpose[{xVal, yVal, uVal}],
    PlotRange -> Automatic, AspectRatio -> 1,
    DataRange -> Automatic],
   {ColorData["LakeColors"][1 - #1] &, 10, MaxU, " " <> MinU,
    LegendPosition -> {1.1, -.4}}];
Show[plt2, plt1]

I use
Needs["PlotLegends`"]
at the beginning.
also
xVal ={10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50,
60, 70, \
80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40,
\
50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10,
\
20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, \
90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50,
\
60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}

yVal= {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20,
20, \
20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 40, 40, 40, 40, \
40, 40, 40, 40, 40, 40, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 60, \
60, 60, 60, 60, 60, 60, 60, 60, 60, 70, 70, 70, 70, 70, 70, 70, 70, \
70, 70, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 90, 90, 90, 90, 90, \
90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}

uVal={22, 28, 4, 32, 38, 20, 0, 14, 31, 34, 16, 17, 11, 29, 37, 55,
11, 3, \
34, 35, 14, 15, 15, 15, 16, 17, 13, 2, 40, 38, 14, 15, 15, 16, 17, \
18, 14, 6, 28, 25, 15, 16, 16, 23, 24, 25, 7, 15, 21, 20, 21, 18, 20,
\
27, 29, 19, 7, 16, 19, 22, 21, 8, 27, 27, 32, 4, 10, 15, 17, 19, 16, \
9, 22, 24, 25, 10, 7, 19, 19, 22, 16, 7, 34, 36, 29, 7, 4, 18, 18, \
20, 15, 12, 24, 27, 30, 0, 2, 18, 18, 18}

Thanks for your help,
Claus



  • Prev by Date: Updated gridMathematica and Mathematica Personal Grid Edition now available
  • Next by Date: Re: JavaView
  • Previous by thread: Updated gridMathematica and Mathematica Personal Grid Edition now available
  • Next by thread: "385-bit SHA code:"