@ClusteredMining fragte Wärmekarte erstellen – Wie definiere ich die Werte für jede Farbe im Farbverlauf?. Dies beantwortet die Frage nicht genau, aber vielleicht. Mithilfe der GradientFunction und einer Farbliste ist es möglich, eine wirklich scharfe Grenze in einer dritten Farbe zu erhalten. Viele Variationen sind möglich, indem eine lange Liste von Farben angepasst wird, um scharfe Grenzen zu erzeugen. Oder verschwommen, was vielleicht schöner aussieht.
Die GradientFunction benötigt etwas JSL, das die Frage beantworten kann: Wie hoch ist hier der Z-Wert? " Diese Funktion ist möglicherweise nicht ohne weiteres verfügbar, da die Daten in einer Tabelle vorliegen und nicht gut gerastert sind.
Bearbeiten: Sie sollten totalWidth wahrscheinlich eher größer als kleiner machen; Es steuert die Anzahl der Farben in der Farbliste, die die Präzision der Kantenplatzierung steuert. Wahrscheinlich sollten Sie auch den Rasterwert etwas vergrößern. Grid=100 und TotalWidth=100 scheinen sinnvoller zu sein als 50 und 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>
Spielen Sie mit Raster, Breite und Gesamtdicke, um interessante Diagramme zu erhalten:
A thin sharply defined green region between red and blue.A thin sharply defined green region between red and blue.A thin sharply defined green region between red and blue.A thin sharply defined green region between red and blue.A thin sharply defined green region between red and blue.Ein dünner, scharf abgegrenzter grüner Bereich zwischen Rot und Blau.
Thicker, and still sharp.Thicker, and still sharp.Thicker, and still sharp.Thicker, and still sharp.Thicker, and still sharp.Dicker und immer noch scharf.
Thicker, and blurry.Thicker, and blurry.Thicker, and blurry.Thicker, and blurry.Thicker, and blurry.Dicker und verschwommen.