MathGroup Archive 2009

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

Search the Archive

Re: MatrixPlot with color range bar

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99058] Re: MatrixPlot with color range bar
  • From: mike.honeychurch at gmail.com
  • Date: Sat, 25 Apr 2009 04:51:50 -0400 (EDT)
  • References: <gss3ff$309$1@smc.vnet.net>

On Apr 24, 5:15 am, =C0=CC=B4=F6=C0=E7 <lee.deok... at gmail.com> wrote:
> Thank you for the answer.
> But ShowLegend doesn't work with MatrixPlot.
> I'd like to plot some numerical data not a function.
> So, I need MatrixPlot not DensityPlot.
>
>
>
>
>
> > Hi,
> > you need e.g. ShowLegend. Look  it up in the manual.
> > Here is an example from the manual:
> > ========================
==
> ====
> > Needs["PlotLegends`"]
> > ShowLegend[
> >  DensityPlot[Sin[x y], {x, 0, \[Pi]}, {y, 0, \[Pi]}, Mesh -> False,
> >  PlotPoints -> 30], {ColorData["LakeColors"][1 - #1] &, 10, " 1",
> >  "-1", LegendPosition -> {1.1, -.4}}]
> > ========================
==
> ======> =========
>
> > Daniel
> =EC=9D=B4=EB=8D=95=EC=9E=AC wrote:
> > I'd like to draw plots like
> >http://www.gle-graphics.org/examples/3dplots/informationgain.png
> > I know that MatrixPlot function draws such plots.
> > My question is how to draw color range bar like that on the right side =
of
> > the plot at the url.
> > Is there any options of MatrixPlot or tricks to draw such color range b=
ar=
>  ?

Inset is probably better than ShowLegend for this:

colourmap =
 DensityPlot[y, {x, 0, 0.1}, {y, 0, 1}, ColorFunction -> "Rainbow",
  AspectRatio -> Automatic, FrameTicks -> {None, Automatic},
  PlotRangePadding -> None];

p1 = MatrixPlot[
  Fourier[Table[
    UnitStep[i, 4 - i] UnitStep[j, 7 - j], {i, -50, 50}, {j, -50,
     50}]]];

Graphics[{Inset[colourmap, {.75, 0}, Center, {1, 1.35}],
  Inset[p1, {-.1, 0}, Center, {1.5, 1.5}]}, PlotRange -> 1.,
 ImageSize -> 400]

Mike


  • Prev by Date: Re: MatrixPlot with color range bar
  • Next by Date: Re: Paste image directly into V7 notebook on Linux/X11
  • Previous by thread: Re: MatrixPlot with color range bar
  • Next by thread: Re: MatrixPlot with color range bar