@ClusteredMining preguntó Creando un mapa de calor: ¿Cómo defino los valores para cada color en el degradado? . Esto no responde exactamente a la pregunta, pero tal vez. Usando la Función Degradado y una lista de colores, es posible obtener un límite realmente nítido en un tercer color. Son posibles muchas variaciones adaptando una larga lista de colores para producir límites nítidos. O borroso, que puede parecer más bonito.
La Función de gradiente necesita un poco de JSL que pueda responder a la pregunta "¿ cuál es el valor Z aquí? " Es posible que esa función no esté disponible porque los datos están en una tabla y no están bien cuadriculados.
editar: Probablemente deberías hacer que totalWidth sea más grande en lugar de más pequeño; controla la cantidad de colores en la lista de colores que controla la precisión de la ubicación del borde. Probablemente también deberías aumentar un poco el valor de la cuadrícula. grid=100 y totalWidth=100 parece más razonable que 50 y 10.
// these are in units of the Z value
range = {100, 400}; // the range of the color list; the formula a*b on the axis 10..20 makes these numbers
targetValue = 200; // happens to go through the corners for this example.
// grid: this determines how many points are evaluated by GradientFunction
grid = 50; // subdivisions, more looks smoother, is slower. typically 50 to 500. 667 may be a limit.
// how many colors in the colorList
thick = 0.050; // thickness of division line, can be 0. 50% is really fat (0.5)
totalWidth = 10; // make this smaller for a blurred edge, maybe 10 or 100 instead of 1000, which has a sharper edge
targetWidth = Round( thick * totalWidth );// making the green target about 10%, so kind of thick
otherwidth = totalWidth - targetWidth; // the ratios, below, divides this in parts
lowRatio = (targetValue - range[1]) / (range[2] - range[1]);// the red
highRatio = 1 - lowRatio;// the blue
// this list is a bunch of repeated reds, a few greens, and a
// bunch of blues. The greens are centered at the targetValue.
colorList = {};
Insert Into( colorList, As List( Repeat( RGB Color( .4, 0, 0 ), Round( otherwidth * lowRatio ) ) ) );
Insert Into( colorList, As List( Repeat( RGB Color( 0, .6, 0 ), targetWidth ) ) );
Insert Into( colorList, As List( Repeat( RGB Color( 0, 0, .4 ), Round( otherwidth * highRatio ) ) ) );
New Window( "target=" || Char( targetValue ),
g = Graph Box(
X Scale( 10, 20 ),
Y Scale( 10, 20 ),
framesize( 600, 400 ),
Gradient Function(
a * b,
a,
b,
Matrix( range ), // range to map the colors onto
Z Color( colorList ),
<<XGRID></XGRID>
<P>Juega con la cuadrícula, el ancho y el espesor total para obtener gráficos interesantes:</P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="A thin sharply defined green region between red and blue." style="width: 666px;"><span class="lia-inline-image-display-wrapper" image-alt="A thin sharply defined green region between red and blue." style="width: 666px;"><img src="https://us.v-cdn.net/6038925/uploads/images/39637iF9D144D14FCB5BE8/ThinSharp.png" role="button" title="ThinSharp.png" alt="A thin sharply defined green region between red and blue." /><span class="lia-inline-image-caption" onclick="event.preventDefault();">A thin sharply defined green region between red and blue.</span></span><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">Una región verde delgada y bien definida entre el rojo y el azul.</SPAN></SPAN></P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thicker, and still sharp." style="width: 666px;"><span class="lia-inline-image-display-wrapper" image-alt="Thicker, and still sharp." style="width: 666px;"><img src="https://us.v-cdn.net/6038925/uploads/images/39638i794FEC6169B31860/ThickSharp.png" role="button" title="ThickSharp.png" alt="Thicker, and still sharp." /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Thicker, and still sharp.</span></span><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">Más grueso y aún afilado.</SPAN></SPAN></P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thicker, and blurry." style="width: 666px;"><span class="lia-inline-image-display-wrapper" image-alt="Thicker, and blurry." style="width: 666px;"><img src="https://us.v-cdn.net/6038925/uploads/images/39639i707AC711B229CFBE/ThickBlurry.png" role="button" title="ThickBlurry.png" alt="Thicker, and blurry." /><span class="lia-inline-image-caption" onclick="event.preventDefault();">Thicker, and blurry.</span></span><SPAN class="lia-inline-image-caption" onclick="event.preventDefault();">Más grueso y borroso.</SPAN></SPAN></P>
<P> </P>