[腳本] 顏色漸層輸出R1=(dt<< 製表(
顯示控制面板( 0 ),
顯示工具提示( 1 ),
新增表格(
列表(統計(N)),
列表( 分組列( :Name( "TEST" ) ), 統計( 行 %, N )),
行表(分組列(:半徑))
)
)) << 製作成資料表;
R1:"N(1)"<< 設定屬性( "顏色漸變", {"白到橘子", Range( {0, 547, 187.945945945946} )} )
<< 依值為儲存格著色;
R1:"N(8)"<< 設定屬性( "顏色漸變", {"白到橘子", Range( {0, 547, 187.945945945946} )} )
<< 依值為儲存格著色;
R1:"N(9)"<< 設定屬性( "顏色漸變", {"白到橘子", Range( {0, 547, 187.945945945946} )} )
<< 依值為儲存格著色;
上面腳本的輸出被組合在一起。 因此,為 N(1)、N(8)、N(9) 設定的顏色梯度已組合,我如何分離每個 N(s) 以擁有自己的特定顏色梯度
回覆:[腳本]顏色漸層輸出嗨,是的,這就是我試圖解決的問題。 非常感謝您的幫助和指導。 抱歉我的英文不好。 謝謝
回覆:[腳本]顏色漸層輸出該腳本失敗,因為沒有定義名為:
從零到三 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
)
);
這是您正在努力解決的問題嗎?
回覆:[腳本]顏色漸層輸出好的,我已經明白我的腳本的問題了。 嘗試運行這個。
<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>
回覆:[腳本]顏色漸層輸出我一定錯過了一些東西,因為顏色漸變,以及你可以控制的指定範圍。 所以我不明白為什麼顏色沒有按照您的意願設定有問題。 以下是讓 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 );
回覆:[腳本]顏色漸層輸出
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的輸出
回覆:[腳本]顏色漸層輸出您能否解釋為什麼超過 99 列會受到限制? 我不明白你的評論。
回覆:[腳本]顏色漸層輸出你好,
好吧,我就是這樣做的,但是隨著資料大小增加到 N(99),所有列都不會套用顏色模式。
有其他方法可以應用顏色圖案嗎?
回覆:[腳本]顏色漸層輸出我希望這就是您所要求的。
要更改顏色圖案,您所要做的就是更改漸層圖案和/或顏色範圍。 下面我選取了第一列 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;回覆:[腳本]顏色漸層輸出您好,附件是R1資料表
回覆:[腳本]顏色漸層輸出能提供一下R1的數據表嗎?