
JMPには様々な用途に対応するカラーテーマがあります。Jetは連続したChromaticテーマの1つです。上のグラフのHeightには適していません。Jetは、背の低い順に色を割り当てようとするのではなく、すべての色を使用しようとしているためです(Sequentialセクションのスキームの方が適しているかもしれません)。見た目はきれいですが、最小値と最大値はかなり暗くなっています。
You can find these themes in Prefs (ctrl-K) -> Graphs, click on the themes to change them.You can find these themes in Prefs (ctrl-K) -> Graphs, click on the themes to change them.これらのテーマは「設定 (ctrl-K) -> グラフ」にあります。テーマをクリックして変更します。
このビデオでは、スケールの中央に明るい線を描く Jet を選択しました。
Zoomed 5X to see the sharp transition.Zoomed 5X to see the sharp transition.急激な変化を観察するために 5 倍にズームしました。
JSLはこちらです。9ピクセルの平均値を使って次の色を取得しているだけです。最終的には、領域間の直線がより直線的になるよう設計されています。
nr = 1080 + 16; // the 16 border is trimmed when the video is made in blender
nc = 1920 + 16; // because the flicker from blue to red to blue is distracting
board = J( nr, nc, Random Uniform( -1, 1 ) ); // only the initial bitmap is random
ww = New Window( "view", img = New Image( Heat Color( (board + 1) / 2, <<"jet" ) ) );
// jet produces the colors from 0 to 1, our bitmap is -1 to 1
dir = "$desktop/heatpic/"; // keep pictures for blender to make into a video
ipic = 1000000; // the picture name is all numeric with a leading 1
For( i = 1, i < 100000, i += 1,
img << setpixels( Heat Color( (board + 1) / 2, <<"jet" ) );
Show( i, i / 100000 );
ww << inval << updatewindow;
Wait( .0 );
img << Save Image( dir || Char( ipic += 1 ) || ".jpg", "jpg" );
background = If( Sum( board ) > 0, -1, 1 ); // keep the red/blue ratio balanced with the border color
step = Ceiling( i / 10000 ) + 3; // speed up the animation towards the end
For( jstep = 1, jstep <= step, jstep += 1,
Parallel Assign(
{
p = .95, // slight extra push away from 0 -- .1^.95 -> .11
L = .999, // regions close to 1 or -1 flip
z = 2.35, // flip value; more than this is unstable
// add padding with background color
prev = J( nr + 2, 1, background ) || (J( 1, nc, background ) |/ board |/ J( 1, nc, background )) || J( nr + 2, 1, background )
},
board[r, c] = (
x = prev[r :: r + 2, c :: c + 2] ; // depends on padding
v = Sum( x ) / 9 ; // each pixel is the average of the 9 pixel square
If( // but...
v < -L, z, // full negative flips to positive
v < 0, -(-v) ^ p, // tweak the average with
v < L, v ^ p, // a push away from zero
-z // full positive flips to negative
)
)
)
);
);
私は約 28K フレーム後に JSL ループを停止しました。これは十分な長さであり、ステップ サイズが増加しても変化率が低すぎるため興味深いものではありませんでした。