View Single Post
Old 08-23-2013, 05:07 AM   #5
Location: RTP, NC, USA

Join Date: Jun 2009
Posts: 28

Okay, a few things going on. First, do you want the range from 0 to 0.4 to be solid white? Right now, your code will set white to ~0.2, since that is the midpoint between 0 and 0.4.

If you want fine-grained control over the color ramps, it may be easier to make 3 color ramps and concatenate them together. So if you want 0 to 0.4 to be white, you can set that ramp all white, for example.

A quick way to test how the colors will get applied is to cut() the m1 matrix using the breaks defined by bk:

m1cut <- cut(m1, bk);
Then look at the levels of m1cut, which will tell you the ranges for which that the color ramp will be applied:

However, I'd suggest using far fewer than 100 breaks, especially for testing! Try something like 5.

For breaks to work, you only need to specify the boundaries where you want your data to be cut(), and then specify a color ramp in sync with those boundary positions. So if you want 0 to 0.4 to be white, specify boundaries at 0, and 0.4, and make sure your color ramp has "white" at that position. I don't know if any of this makes sense without R code...
jmw86069 is offline   Reply With Quote