Re: MatrixPlot: range of colors and plot legend?
- To: mathgroup at smc.vnet.net
- Subject: [mg106874] Re: [mg106847] MatrixPlot: range of colors and plot legend?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 25 Jan 2010 05:10:06 -0500 (EST)
- Reply-to: hanlonr at cox.net
Needs["PlotLegends`"]
data = RandomReal[{0, 1}, {10, 10}];
ShowLegend[
MatrixPlot[data,
ColorFunction -> (GrayLevel[1 - #] &),
ColorFunctionScaling -> False],
{GrayLevel, 10, "1", "0",
LegendPosition -> {1.1, -0.4}}]
xmin = Min[data];
xmax = Max[data];
ShowLegend[
MatrixPlot[data,
ColorFunction ->
(GrayLevel[1 - (# - xmin)/(xmax - xmin)] &),
ColorFunctionScaling -> False],
{GrayLevel, 10,
ToString[xmax], ToString[xmin],
LegendPosition -> {1.1, -0.4}}]
Bob Hanlon
---- dantimatter <google at dantimatter.com> wrote:
=============
Hello All,
I'm having a little bit of trouble with MatrixPlot:
1) It looks to me like the default color set goes from a pale, sandy
orange to a dark orange. Well, it would be more correct to say that
my wife told me that the default color set goes from a pale, sandy
orange to a dark orange, since I'm essentially color blind. Is there
a color set that goes from white to black through all the shades of
grey? And would I need to scale the numbers appropriately? They're
currently running from approximately 0 to 1.
2) Is there a command or an option that would give me a legend?
Cheers,
Dan