Dynamic 在Mathematica中操作自定义表格表示
考虑以下数据示例:Dynamic 在Mathematica中操作自定义表格表示,dynamic,wolfram-mathematica,tabular,Dynamic,Wolfram Mathematica,Tabular,考虑以下数据示例: data ={ {"a", "b", "c", "d", "e"}, {1, 2, 3, 4, 5}, {11, 12, 13, 14, 15}, {21, 22, 23, 24, 25} }; 和以下生成自定义表格表示的函数: data ={ {"a", "b", "c", "d", "e"}, {1, 2, 3, 4, 5}, {11, 12, 13, 14,
data ={
{"a", "b", "c", "d", "e"},
{1, 2, 3, 4, 5},
{11, 12, 13, 14, 15},
{21, 22, 23, 24, 25}
};
和以下生成自定义表格表示的函数:
data ={
{"a", "b", "c", "d", "e"},
{1, 2, 3, 4, 5},
{11, 12, 13, 14, 15},
{21, 22, 23, 24, 25}
};
(你可以参考。
最后通牒是,我也会操纵他提供的选项(目前)
我想使用操纵或动态来显示我的数据使用上述部分。
这可以选择要显示的列的范围、要显示的行数以及颜色
下面是我未完成的尝试
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解决方案,我现在能做什么:
data ={
{"a", "b", "c", "d", "e"},
{1, 2, 3, 4, 5},
{11, 12, 13, 14, 15},
{21, 22, 23, 24, 25}
};
尝试以下方法:
colsel = (#->Graphics[{#, Disk[]},ImageSize -> 15])& /@ColorData[1, "ColorList"];
s[x_] := Style[x, Black, Bold, 12];
ct = ControlType -> PopupMenu;
Manipulate[
DataSampleX[data, linesNumber, range1, range2, color1, color2, color3],
Row[{
Column[{
Control@{{range1, 1, s@"Range1"}, Range[1, Length@data[[1]] - 1], ct},
Control@{{range2, 2, s@"Range2"}, Range[2, Length@data[[1]] - 1], ct},
Control@{{linesNumber, 2, s@"Lines"}, Range[2,Length@data[[All, 1]]-1],ct}}],
Spacer[20],
Column[{
Control@{{color1, colsel[[1, 1]], s@"Color 1"}, colsel, ct},
Control@{{color2, colsel[[2, 1]], s@"Color 2"}, colsel, ct},
Control@{{color3, colsel[[3, 1]], s@"Color 3"}, colsel, ct}}]
}]]
@500你难道不喜欢Mma的那些小把戏吗?比如在你应该放文本的地方显示一个彩色磁盘?@Belisarius,你如何防止控制中的range1>range2?@500尝试在range1限制中使用Range[1,range2]spec@Belisarius,考虑到你解决我的问题的速度和优雅程度,我有一个梦想:所有的列标题都能成为你点击的setter按钮,将其添加到显示中。与其设置范围,不如单击要显示的列的所有名称。这是可行的吗?我会发布一个新问题,是吗@500这些是“索引”颜色贴图。颜色数据[1]。。。彩色数据[62]。。。无需使用“名称”