4
建立在Belisarius在"Manipulate custom Tabular"提出的解決方案上。在Mathematica動態列表中選擇另一個動態
考慮下面的函數來創建自定義表格表示:
DataSampleXX[data_, linesNumber_, columnsList_, color1_, color2_, color3_] := Grid[ Join[ {columnsList}, {Map[Rotate[Text[#], 90 Degree] &, data[[1, columnsList]]]}, data[[2 ;; linesNumber, columnsList]]], Background -> {{{{color1, color2}}, {1 -> color3}}}, Dividers -> {All, {1 -> True, 2 -> True, 3 -> True, 0 -> True}}, ItemSize -> {1 -> Automatic, Automatic}, Alignment -> Top, Frame -> True, FrameStyle -> Thickness[2], ItemStyle -> {Automatic, Automatic, {{1, 1}, {1, Length[data]}} -> Directive[FontSize -> 15, Black, Bold]} ];
,後面的數據:
soData = {{"col1", "col2", "col3", "col4", "col5", "col6", "col7", "col8", "col9", "col10"}, Range[1, 10], Range[11, 20], Range[21, 30], Range[31, 40]} With[ {columnsList = {1, 3}, data = soData, linesNumber = 3, color1 = LightBlue, color2 = LightRed, color3 = LightGray}, DataSampleXX[data, linesNumber, columnsList, color1, color2, color3]]
我想集成下面的Dynamic來提供
DataSampleXX
函數的columnsList
參數。Manipulate[[email protected][Sequence @@ {a, b}], Evaluate[Sequence @@ MapThread[{{#1, {}, ""}, #2, ControlType -> TogglerBar} &, {{a, b}, Partition[Rule @@@ Transpose[{Range[10], soData[[1]]}], 5]}]], ControlPlacement -> Top]
- 這將使我動態選擇列(VS一系列在我剛纔的問題列)使用
DataSampleXX
顯示,但我又不能老是圖瞭解如何合併這兩種機制。
@Belisarius,它是!現在,我的問題是,我有100列,這就是爲什麼我分成五組,有沒有辦法調整你的代碼這樣做呢?另外,我曾經試着根據你提供的地址向你發送一封電子郵件在你的個人資料上沒有成功我想告訴你我使用某些解決方案的方式! – 500 2011-06-16 17:10:15
@ 500讓我看看我能不能找出一百個問題的答案。重新「我的電子郵件」......它正在工作。聽起來很愚蠢,但是......你用相應的符號代替了「[點]」和「[at]」嗎? – 2011-06-16 17:31:32
@Belisarius,剛剛發給你一封電子郵件,以防它進入你的垃圾郵件箱。我希望我的代碼不會讓你的專家眼光難看。非常感謝您的關注。 – 500 2011-06-16 19:41:15