拆分錶格時保持細胞顏色嗨,
我用了示例Sample 49836將一列中的單元格按不同列中的值著色 ,但現在我需要分割表並保持單元格顏色。
我之前看過關於連接表的討論,其中一些關於如何再次獲得顏色的工作。
使用拆分錶有類似的方法嗎?
謝謝
回复:分割表格時保持單元格顏色再次感謝您的幫助,我將使用您的示例並相應地調整代碼。
回复:分割表格時保持單元格顏色我知道你沒有提供關於你的分裂的準確信息。 我提供我生成的例子的意圖是給你一個解決問題必須採取的一般方法的例子。 我假設您應該能夠採用我給出的示例並進行擴展和更改以滿足您的精確規格。
回复:分割表格時保持單元格顏色感謝您及時的回复,
問題是我需要將表拆分為其他列,然後是用於設置顏色的列。
在我們的例子中,我需要將表拆分為:sex,而顏色由:age定義。
dtSplit = DT < < 分裂 ( 拆分 ( : 性別 ) ,分裂 ( : 高度 ) ,剩餘的列 ( 下降所有 ) ,排序方式柱屬性 ) ;
再次感謝,
然
回复:分割表格時保持單元格顏色以下是您引用的示例的擴展,它可能會為您提供有關如何傳輸顏色的一些提示
/* Open a sample data table */
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
/* Obtain a list of unique values of age */
Summarize( a = By( :age ) );
/* Assign rowstate colors by the values in the age column */
dt << Color by Column( :age, Color Theme( "JMP Dark" ) );
/* Loop through each unique age and assign the rowstate color to the Color Cells */
For( i = 1, i <= N Items( a ), i++,
r = As List( dt << Get Rows Where( :age == Num( a[i] ) ) );
Column( dt, "height" ) << Color Cells( Color Of( Row State( r[1] ) ), r );
);
dtSplit = dt << Split( Split By( :age ), Split( :height ), Remaining Columns( Drop All ), Sort by Column Property );
// loop across all of the columns, and color the non missing cells with the
// color they had in the original data table
For( i = 1, i <= N Cols( dtSplit ), i++,
// Create a row list from the original table, based upon the column name
// in the split data table
r = As List( dt << Get Rows Where( :age == Num( Column( dtSplit, i ) << get name ) ) );
// Create a list of non missing rows in the split data table
r1 = As List( dtSplit << Get Rows Where( Is Missing( Column( dtSplit, i )[Row()] ) == 0 ) );
// Point back to the original data table and get the color from the row state
Current Data Table( dt );
TheColor = Color Of( Row State( r[1] ) );
// Point to the split table, and set the color of all of the
// non missing cells to the color found in the original table
Current Data Table( dtSplit );
Column( dtSplit, i ) << Color Cells( TheColor, r1 );
);
回复:分割表格時保持單元格顏色這是一個,對不起,我沒有把鏈接放在我的第一篇文章中。
分裂後,我得到許多沒有任何顏色的連續列。
我注意到的奇怪的事情是,當我分割彩色字符列時,我確實得到顏色但不是正確的顏色..
如果顏色正確,我可以將列更改為Charecter,拆分然後再更改為Continues,但無論如何它不是一個優雅的解決方案。
再次感謝
回复:分割表格時保持單元格顏色我認為OP指的是這個支持說明 。
回复:分割表格時保持單元格顏色請原諒我的無知,但我在哪裡可以找到 “樣本49836將一列中的單元格按不同列中的值著色”。
沒有直接的方法來保持單元格的顏色,但如果我能看到您引用的樣本的細節,我可能能夠制定解決方案。