[스크립트] 컬러 그라데이션 출력R1=(dt<< 표로 작성(
제어판 표시( 0 ),
도구 설명 표시( 1 ),
테이블 추가(
열 테이블(통계(N)),
열 테이블( 열 그룹화( :Name( "TEST" ) ), 통계( 행 %, N )),
행 테이블( 열 그룹화( :Radius ) )
)
)) << 데이터 테이블로 만들기;
R1:"N(1)"<< 속성 설정( "색상 그라데이션", {"흰색에서 주황색으로", 범위( {0, 547, 187.945945945946} )} )
<< 값별로 셀 색상 지정;
R1:"N(8)"<< 속성 설정( "색상 그라데이션", {"흰색에서 주황색으로", 범위( {0, 547, 187.945945945946} )} )
<< 값별로 셀 색상 지정;
R1:"N(9)"<< 속성 설정( "색상 그라데이션", {"흰색에서 주황색으로", 범위( {0, 547, 187.945945945946} )} )
<< 값별로 셀 색상 지정;
위 스크립트의 출력이 함께 결합됩니다. 따라서 N(1), N(8), N(9)에 대해 설정된 색상 그라데이션이 결합되었습니다. 고유한 특정 색상 그라데이션을 갖도록 각 N(s)을 어떻게 분리합니까?
Re: [스크립트] 색상 그라데이션 출력안녕하세요, 예, 이것이 제가 해결하려고 했던 문제였습니다. 많은 도움과 지도에 감사드립니다. 내 영어가 서툴러서 미안해요. 감사해요
Re: [스크립트] 색상 그라데이션 출력다음과 같이 정의된 열이 없기 때문에 스크립트가 실패합니다.
0에서 3까지 3
로그에 다음 오류가 발생합니다.
Scoped data table access requires a data table column or variable in access or evaluation of 'dt:zero to three 3' , dt:zero to three 3/*###*/
이는 여러 가지 방법으로 처리될 수 있습니다. "하드 코딩"을 계속 사용하려면 "시도" 기능을 사용하여 문제를 극복할 수 있습니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << New Column( "zero to three", formula( Random Integer( 0, 3 ) ) );
dt << New Column( "zero to three 2", formula( Random Integer( 0, 3 ) ) );
dt << New Column( "zero to three 4", formula( Random Integer( 0, 3 ) ) );
Try( dt:zero to three << Set Property( "Color Gradient", {"White to Orange"} ) << Color Cell by Value );
Try( dt:zero to three 2 << Set Property( "Color Gradient", {"White to Orange"} ) << Color Cell by Value );
Try( dt:zero to three 3 << Set Property( "Color Gradient", {"White to Orange"} ) << Color Cell by Value );
Try( dt:zero to three 4 << Set Property( "Color Gradient", {"White to Orange"} ) << Color Cell by Value );
또는 좀 더 발전하여 어떤 이름이 원하는 패턴과 일치하는지 확인하고 일치하면 색상 그라데이션을 적용할 수 있습니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << New Column( "zero to three", formula( Random Integer( 0, 3 ) ) );
dt << New Column( "zero to three 2", formula( Random Integer( 0, 3 ) ) );
dt << New Column( "zero to three 4", formula( Random Integer( 0, 3 ) ) );
ColNames = dt << get column names( string, numeric );
For( i = 1, i <= N Items( ColNames ), i++,
If( Contains( Uppercase( ColNames[i] ), "ZERO TO THREE" ) == 1,
Column( dt, ColNames[i] ) << Set Property( "Color Gradient", {"White to Orange"} ) << Color Cell by Value
)
);
이것이 해결하려는 문제입니까?
Re: [스크립트] 색상 그라데이션 출력좋아, 내 스크립트의 문제를 이해했습니다. 이것을 실행해 보세요.
<SPAN class="token function">Names default to here</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token number">1</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
dt<SPAN class="token operator">=</SPAN><SPAN class="token function">open</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token string">"$SAMPLE_DATA\big class.jmp"</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
dt<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token function">new column</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token string">"zero to three"</SPAN><SPAN class="token punctuation">,</SPAN> formula<SPAN class="token punctuation">(</SPAN><SPAN class="token function">random integer</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token number">0</SPAN><SPAN class="token punctuation">,</SPAN><SPAN class="token number">3</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
dt<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token function">new column</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token string">"zero to three 2"</SPAN><SPAN class="token punctuation">,</SPAN> formula<SPAN class="token punctuation">(</SPAN><SPAN class="token function">random integer</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token number">0</SPAN><SPAN class="token punctuation">,</SPAN><SPAN class="token number">3</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;<BR /></SPAN>dt<<NEW column="">:zero to three <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Set Property<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Color Gradient"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token punctuation">{</SPAN><SPAN class="token string">"White to Orange"</SPAN><SPAN class="token punctuation">}</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Color Cell by Value<SPAN class="token punctuation">;</SPAN>
dt<SPAN class="token punctuation">:</SPAN>zero to three <SPAN class="token number">2</SPAN> <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Set Property<SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Color Gradient"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token punctuation">{</SPAN><SPAN class="token string">"White to Orange"</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">)</SPAN> <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Color Cell by Value<SPAN class="token punctuation">;<BR />dt:zero to three 3 << Set Property( "Color Gradient", {"White to Orange"}) << Color Cell by Value;<BR />dt:zero to three 4 << Set Property( "Color Gradient", {"White to Orange"}) << Color Cell by Value</SPAN></NEW>
Re: [스크립트] 색상 그라데이션 출력색상 그라데이션과 지정된 범위를 제어할 수 있기 때문에 뭔가 빠진 것이 있는 것 같습니다. 그래서 색상이 원하는 대로 설정되지 않는 문제가 왜 발생하는지 알 수 없습니다. 다음은 JMP가 값의 범위를 평가하여 색상을 설정하는 예와 값을 설정하는 두 번째 예입니다.
이러한 값은 열 평균을 계산하거나 원하는 방법으로 설정할 수 있습니다.
Names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");
dt<<NEW column=""></NEW>
이제 특정 셀에 색상을 명시적으로 설정하려는 경우 그렇게 할 수 있습니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Age << Color Cells( "Red",5 );
Re: [스크립트] 색상 그라데이션 출력
This is run with the given scriptThis is run with the given script이것은 주어진 스크립트로 실행됩니다
This is the type colour gradient that i am talking aboutThis is the type colour gradient that i am talking about 이것이 내가 말하는 유형의 색상 그라데이션입니다.
그림 2의 출력을 원합니다.
Re: [스크립트] 색상 그라데이션 출력99개 열을 초과하는 것이 제한되는 이유를 설명해 주시겠습니까? 나는 당신의 의견을 이해하지 못합니다.
Re: [스크립트] 색상 그라데이션 출력안녕,
글쎄요, 이런 식으로 하고 있는데 데이터 크기가 N(99)으로 증가하면 모든 열에 색상 패턴이 적용되지 않습니다.
색상 패턴을 적용하는 다른 방법이 있나요?
Re: [스크립트] 색상 그라데이션 출력이것이 당신이 요구하는 것이기를 바랍니다.
색상 패턴을 변경하려면 그라데이션 패턴 및/또는 색상 범위를 변경하기만 하면 됩니다. 아래에서는 첫 번째 열 N(1)을 가져와서 그래디언트를 변경했습니다.
R1:"N(1)" << Set Property( "Color Gradient", {"Blue to Green to Red", Range( {31, 284, 150} )} ) << Color Cell by Value;
R1:"N(8)" << Set Property( "Color Gradient", {"White to Orange", Range( {0, 547, 187.945945945946} )} ) << Color Cell by Value;
R1:"N(9)" << Set Property( "Color Gradient", {"White to Orange", Range( {0, 547, 187.945945945946} )} ) << Color Cell by Value;Re: [스크립트] 색상 그라데이션 출력안녕하세요 첨부파일은 R1 데이터 테이블입니다
Re: [스크립트] 색상 그라데이션 출력R1 데이터 테이블을 제공할 수 있습니까?