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