MathGroup Archive 2008

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

Search the Archive

Re: ShowLegend font size

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90269] Re: ShowLegend font size
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 4 Jul 2008 03:56:28 -0400 (EDT)
  • References: <g4i917$3at$1@smc.vnet.net>

What good is a density plot legend that is only labeled at the ends? You can 
construct a much nicer plot legend yourself. And since when are lakes 
purple? Create the density plot, then create a legend using a ContourPlot, 
and then put them together on a piece of paper using Inset and Text 
statements.

densityplot =
  DensityPlot[Sin[x y], {x, 0, \[Pi]}, {y, 0, \[Pi]},
   Mesh -> False,
   PlotPoints -> 30,
   ColorFunction -> "FallColors",
   AspectRatio -> Full,
   PlotRange -> {{0, \[Pi]}, {0, \[Pi]}},
   Frame -> True,
   PlotRangePadding -> 0.05,
   FrameLabel -> {x, y},
   PlotLabel -> Sin[x y],
   BaseStyle -> {FontSize -> 12},
   ImageSize -> {400, 450}
   ];

plotlegend =
  ContourPlot[y, {x, 0, 1}, {y, -1, 1},
   Contours -> Range[-1, 1, 0.25],
   ColorFunction -> "FallColors",
   PlotPoints -> 51,
   AspectRatio -> Full,
   PlotRange -> {{0, 1}, {-1, 1}},
   Background -> None,
   Frame -> True,
   FrameTicks -> {None, Range[-1, 1, 0.25], None, None},
   ImagePadding -> {{25, 2}, {5, 5}},
   BaseStyle -> {FontSize -> 12},
   ImageSize -> {50, 400}];

Graphics[
 {Inset[densityplot, {4, 4.3}, {Center, Center}, {400, 450} 0.02],
  Inset[plotlegend, {8.8, 4.2}, {Center, Center}, {5, 40} 0.17],
  Text[Style["Density Plot with Legend", Large], {5, 9.3}],
  Text[Style["Legend", 14], {9.0, 8.3}]},
 PlotRange -> {{0, 10}, {-.25, 10}},
 Frame -> False,
 ImageSize -> 500]


-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/


"Jan Schmedes" <jasch at crustal.ucsb.edu> wrote in message 
news:g4i917$3at$1 at smc.vnet.net...
> Dear Group,
>
> in a call of ShowLegend like the following from the documentation
> center, how do I change the font size for the "1" and "-1".
> Something like Style["1",14] or Text@Style["1",14] does not seem to
> work here
>
> ShowLegend[
>  DensityPlot[Sin[x y], {x, 0, =B9}, {y, 0, =B9}, Mesh -> False,
>   PlotPoints -> 30], {ColorData["LakeColors"][1 - #1] &, 10, " 1",
> "-1",
>   LegendPosition -> {1.1, -.4}}]
>
>
> Thank you!!!
>
> Jan
> 



  • Prev by Date: programming a simple neural network
  • Next by Date: Re: The show command freezes
  • Previous by thread: Re: ShowLegend font size
  • Next by thread: Mathematica into generic code?