在Mathematica中操作自定义表格表示形式
|
考虑以下数据示例:
data ={
{\"a\", \"b\", \"c\", \"d\", \"e\"},
{1, 2, 3, 4, 5},
{11, 12, 13, 14, 15},
{21, 22, 23, 24, 25}
};
并使用以下函数来生成定制的表格表示形式:
(您可以参考Mr.Wizard广泛的解决方案以获取可自定义的表格表示形式。
最终我也将暂时操纵他提供的选项)
DataSampleX[data_, linesNumber_, range1_, range2_, color1_, color2_, color3_] :=
Grid[
Join[
{Range[range1, range2]}, {Map[Rotate[Text[#], 90 Degree] &,
data[[1, range1 ;; range2]]]},
data[[2 ;; linesNumber, range1 ;; range2]]
],
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]}
];
我想使用Manipulate或Dynamic通过上述方法显示部分数据。
选择我要显示的列范围,要显示的行数以及颜色。
以下是我未完成的尝试。
PopupMenu[Dynamic[range1], Range[1, Length@data[[1]] - 1, 1]]
PopupMenu[Dynamic[range2], Range[2, Length@data[[1]], 1]]
PopupMenu[Dynamic[linesNumber], Range[2, Length@data[[All, 1]] - 1, 1]]
Dynamic[DataSampleX[data, linesNumber, range1, range2, LightBlue,
LightGray, LightYellow]]
如何使用setter更新颜色值?
是否可以在“操纵”窗口中实际使用它?
欢迎提出任何其他建议,以使这种高效外观更好。
编辑:由于下面的Belisarius解决方案,我现在能做的事情:
没有找到相关结果
已邀请:
1 个回复
鞘垒飘