MathGroup Archive 2006

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

Search the Archive

Re: LegendPosition Problem

  • To: mathgroup at
  • Subject: [mg68843] Re: LegendPosition Problem
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Mon, 21 Aug 2006 03:27:41 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <ec9828$4fi$>
  • Sender: owner-wri-mathgroup at

Paul Townley-Smith wrote:
> I'm running 5.2 and trying to position a legend.  No matter what coordinates 
> I give, the legend is always in the bottom left...what am I doing wrong. 
> The following sample code below puts the legend in the lower left on my 
> machine, even though this is supposed to be an example where the legend is 
> in the in middle right.
> ShowLegend[
> DensityPlot[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, Mesh -> False,
> PlotPoints -> 30, DisplayFunction -> Identity], {GrayLevel[1 - #] &, 10,
> " 1", "-1", LegendPosition -> {1.1, -.4}}]

Hi Paul,

On my system, the code you gave works like a charm: the legend is 
displayed on the middle-right of the diagram. Have you loaded any other 
packages in addition to Graphics`Legend that might conflict with the 
definition of ShowLegend? Try with a fresh kernel and do not load any 
packages except Graphics`Legend. See what happens then.

ShowLegend[ DensityPlot[ Sin[ x y], { x,0,Pi}, { y,0,Pi}, Mesh->False, 
PlotPoints->30, DisplayFunction->Identity], { GrayLevel[ 1-#]&,10," 
1","-1", LegendPosition-> { 1.1, -.4}}];
--> "5.2 for Microsoft Windows (June 20, 2005)"


  • Prev by Date: Re: Need good reference for writing Stylesheets
  • Next by Date: Re: Problem with NMaximize
  • Previous by thread: Re: LegendPosition Problem
  • Next by thread: RE:How to set up a diff equation for circuit with a diode?