Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.4K Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

[?]  Color Function not correctly mapping to range?

Posted 8 years ago
POSTED BY: John Travolski
3 Replies

This is the normal behavior with 2D plotting functions, the values are rescaled to lie between 0 and 1 before being fed to the color function. If you use the option PlotLegends -> Automatic you can see the color mapping that is being used. Use the option ColorFunctionScaling -> False for your ArrayPlot call to turn off the automatic rescaling.

See http://reference.wolfram.com/language/ref/ColorFunctionScaling.html, or https://mathematica.stackexchange.com/search?q=colorfunctionscaling for more information.

POSTED BY: Jason Biggs
Posted 8 years ago

If I turn off automatic rescaling, then how do I determine which value corresponds to what color?

POSTED BY: John Travolski
Posted 8 years ago

If automatic rescaling is turned off, then the coloring is exactly as given by your ColorFunction. If you say ColorFunction -> myColorFunc, ColorFunctionScaling -> False, then 0.3 should be colored exactly as myColorFunc[ 0.3]. Use PlotLegends -> Automatic to see a color bar.

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard