MathGroup Archive 2009

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

Search the Archive

Re: MatrixPlot with color range bar

But most custom graphics requires custom work. The built-in Mathematica 
=E2=80=98set-piece-plots=E2=80=99 only work well for restricted classes 
of plots. So in general one should expect to have to do the work. 
Usually, each graphics problem requires it own solution. Of course, if 
you had many different matrices that you wanted to plot, you could write 
a routine that would simplify it for you =E2=80=93 producing your own 
plot type so to speak.

Often it is easier, and more rewarding, to put together detailed 
primitives in a custom graphic, than to try to tweak an existing WRI 

David Park

djmpark at 

From: asitdepends at [mailto:asitdepends at] On Behalf Of 

Thank you very much !
I tried your code. The plot looks very nice.
Although it's very nice, i expect more simple method to be included in 
the next version of Mathematica.

2009/4/25 David Park <djmpark at>

My suggestion:

data = Table[Cos[x y/150.], {x, -50, 50}, {y, -50, 50}];

matrixplot =
 MatrixPlot[data, ColorFunction -> "Rainbow"];

legend =
 DensityPlot[y, {x, 0, 1}, {y, -1, 1},
  ColorFunction -> (ColorData["Rainbow"][Rescale[#, {-1, 1}]] &),
  ColorFunctionScaling -> False,
  PlotPoints -> 51,
  AspectRatio -> Full,
  PlotRange -> {{0, 1}, {-1, 1}},
  Background -> None,
  Frame -> True,
  FrameTicks -> {{None, Range[-1, 1, .25]}, {None, None}},
  ImagePadding -> {{2, 30}, {5, 5}},
  ImageSize -> {50, 400}];

 {Inset[matrixplot, {4, 4.3}, {Center, Center}, {400, 450} 0.02],
 Inset[legend, {8.8, 4.2}, {Center, Center}, {5, 40} 0.17],
 Text[Style["Matrix Plot with Legend", Large], {5, 9.3}],
 Text[Style["Legend", 14, Bold], {8.5, 8.0}]},
 PlotRange -> {{0, 10}, {0, 10}},
 Frame -> False,
 ImageSize -> 500]

David Park
djmpark at <>

From: =EC=9D=B4=EB=8D=95=EC=9E=AC [mailto:lee.deokjae at]

I'd like to draw plots like
I know that MatrixPlot function draws such plots.
My question is how to draw color range bar like that on the right side =
the plot at the url.
Is there any options of MatrixPlot or tricks to draw such color range =
bar ?

  • Prev by Date: Re: issues with GraphPlot
  • Next by Date: Re: Re: Jacobi polynomials in Mathematica
  • Previous by thread: Re: MatrixPlot with color range bar
  • Next by thread: Re: Re: MatrixPlot with color range bar