@ClusteredMining尋ねたヒート マップの作成 - グラデーションの各色の値を定義するにはどうすればよいですか?. これは質問に正確に答えているわけではありませんが、多分。 GradientFunction とカラー リストを使用すると、3 番目のカラーで非常にシャープな境界を取得できます。 色の長いリストを調整して鮮明な境界を生成することにより、多くのバリエーションが可能です。 またはぼやけて、きれいに見えるかもしれません。
GradientFunction には、「質問に答えることができる JSL が少し必要です」ここでの Z 値は? " データがテーブルにあり、適切にグリッド化されていないため、その関数はすぐには利用できない場合があります。
編集: おそらく、totalWidth を小さくするのではなく、大きくする必要があります。エッジ配置の精度を制御する colorList の色の数を制御します。 おそらく、グリッド値も少し大きくする必要があります。 grid=100 と totalWidth=100 は、50 と 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>
grid、width、および totalThick を操作して、興味深いグラフを取得します。
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.赤と青の間の薄くてはっきりと定義された緑の領域。
Thicker, and still sharp.Thicker, and still sharp.Thicker, and still sharp.Thicker, and still sharp.Thicker, and still sharp.より厚く、それでもシャープ。
Thicker, and blurry.Thicker, and blurry.Thicker, and blurry.Thicker, and blurry.Thicker, and blurry.より厚く、ぼやけています。