응답에 사용 가능한 색상 매핑 : JMP에 내장 된 색상 테마를 사용하거나 JMP에서 도구를 사용하여 사용자 정의 매핑을 작성할 수 있습니다. 커스텀 매핑을 사용하려면 JSL을 작성해야한다. 테마가 아닙니다.
내장 된 테마 사용 : HeatColor 함수는 0과 1 사이의 숫자를 색상으로 매핑합니다. 이 예제에서는 두 가지 테마, "jet"및 "spectral"를 사용하여 다음 그림을 만듭니다.
New Window( "Example", Graph Box( Y Scale( -0.6, 1.6 ), X Scale( -5, 105 ),
framesize( 700, 300 ), Marker Size( 6 ), suppressAxes,
For( x = 0, x <= 100, x += .0625,
Pen Color( Heat Color( x / 100, "jet" ) );
Line( {x, 0}, {x, .5} );
Pen Color( Heat Color( x / 100, "spectral" ) );
Line( {x, .6}, {x, 1.1} );
);
Text Color( "black" );
Text( right justified, {98, .1}, "jet color interpolation" ); // use right
Text( right justified, {98, .7}, "spectral color interpolation" ); // justification
)
);

HeatColor에 대한 자세한 정보 : 그래픽 함수
내장 된 테마는 친절하고 사용하기 쉽지만 다른 것이 필요할 수도 있습니다. 다음 예제에서는 JMP에서 보간을 위해 Interpolate 및 SplineEval의 두 가지 다른 함수를 보여줍니다. 둘 다 장단점이 있습니다. 먼저 그림의 코드는 다음과 같습니다.
smooth = 300; // bigger numbers make a stiffer spline
xRange = 0 :: 100; // graph plotted over this range
// greenX,greenY define 5 "control" points for the color; the Y value is the green in RGB
greenX = [0 3 5 7 10] ^ 2; // unevenly spaced points in X: [0 9 25 49 100]
greenY = [0.1 0.4 0.9 0.4 0.1]; // uneven in Y too
// greenCoef is computed once, used a lot in the evaluator
greenCoef = Spline Coef( greenX, greenY, smooth ); // make the coefficients once
greenSpline = Spline Eval( xRange, greenCoef ); //use them here, and below
// greenSpline as a matrix of Ys for each X in the xRange argument
// or...linear piece-wise interpolation (the first argument must be a scalar at this time)
greenLinear = J( 1, N Cols( xRange ), 0 ); // unlike spline, for now at least,
For( i = 1, i <= N Cols( xRange ), i++, // interpolate generates one answer per call
greenLinear[i] = Interpolate( xRange[i], greenX, greenY ); // edgy version of smooth spline
);
// graph the spline and linear colors
New Window( "Example", Graph Box( Y Scale( -0.6, 1.6 ), X Scale( -5, 105 ),
framesize( 700, 300 ), Marker Size( 6 ), suppressAxes,
Pen Color( "green" ); Pen Size( 5 );
Line( xRange, greenSpline ); // draw the smooth spline, thick, green
Pen Color( "blue" ); Pen Size( 3 );
Line( xRange, greenLinear ); // draw the pointy linear interpolation, thinner, blue
// next, draw the large black round marker dots...
Marker( Combine States( Color State( "black" ), Marker State( 12 ) ), greenX, greenY );
// draw the horizontal color bars, above and below the graph
Pen Size(1);
For( x = 0, x <= 100, x += .0625, // generate enough short vertical lines to make a
// solid patch of color. set the color of each line by spline...
Pen Color( RGB Color( 0, Spline Eval( x, greenCoef ), .5 ) ); // use the coefficients again
Line( {x, 1.1}, {x, 1.5} ); // color bar above the graph is for spline
Pen Color( RGB Color( 0, Interpolate( x, greenX, greenY ), .5 ) ); // set color by linear
Line( {x, -.1}, {x, -.5} ); // color bar below graph is linear interpolation
);
// label the color bars. Should work OK with reasonable sized fonts...
Text Color( "white" ); // lands on top of the dark part of the color bar
Text( right justified, {98, -.4}, "linear color interpolation" ); // use right
Text( right justified, {98, 1.2}, "spline color interpolation" ); // justification
)
);

그림은 녹색 스플라인 곡선과 파란색 선형 보간 곡선을 보여줍니다. 두 곡선 모두 5 개의 검정색 제어점에 대해 작성됩니다. 그림의 맨 위에는 녹색 색상 구성 요소를 녹색 스플라인 곡선 값으로 설정하여 만든 색상 막대가 표시됩니다. 그림의 하단에는 비슷한 색상의 막대가 표시되지만 녹색 구성 요소는 선형 보간에서 비롯됩니다.
당신은 이미 하단 바에서 지나치게 밝은 지점에 산만 해졌을 수도 있습니다. 걱정하지 마라, 정말로 거기에 없다, 그것은 관련이있다. 마흐 밴드 - 위키 백과, 무료 백과 사전 . 그러나 이것이 스플라인 보간을 선호하는 이유입니다. 스플라인 보간은 서로 다른 이슈를 가지고 있습니다. 상단 막대는 하단 막대만큼 밝은 녹색을 얻지 못합니다. 이 경우에는 말하기가 어렵지만, 최종 점 아래로 떨어집니다. 위 JSL의 첫 번째 줄인 smooth = 300은 스플라인의 강성 / 장력을 설정합니다. 애플리케이션에 적합한 값을 선택해야합니다.
HeatColor 예제에서 0..1 인수 (아마도 SQRT 사용)를 변형하여 색상을 늘릴 수 있습니다. 스플라인과 보간 모두를 사용하면 필요에 따라 많은 제어점을 입력하여 색상 공간을 대신 스트레치 / 스킬링 할 수 있습니다 (이 예와 같이). 빨간색과 파란색 채널을 추가하고 자신의 프로파일을 제공 할 수 있습니다.
첨부 된 파일은 게시물의 코드와 동일합니다.
SplineEval에 대한 자세한 정보 : 추가 참고 사항
Interpolate에 대한 자세한 내용 : 조건부 함수
이전 블로그 형식의 변환에서 살아남지 못했던 형식 및 코드 복구 용으로 4Jan2017을 업데이트했습니다.