gpt4 book ai didi

graphics - 在 Mathematica 中排列和显示网格的各个部分

转载 作者:行者123 更新时间:2023-12-01 09:06:57 24 4
gpt4 key购买 nike

为了快速找到我的数据的位置,我显示了一个表格,其中包含我的变量名称以及每个变量的信息。

因为我有很多列(变量),所以我将它的 block 复制并粘贴到一个单元格中,以便将它们全部显示在一个屏幕上。

我想对此进行编码,这样我就可以输入几个要提取的行范围,并在适合屏幕区域的网格上有效地显示一些内容?我还没有很好地同时显示 2 个网格。

如果上面我没有正确表达我的问题,这里有一个简单的例子:

如果 laList 的输出是我们必须处理的,我如何将蓝色部分移到粉红色部分的一侧?

co1    = Range[6];
co2 = Range[11, 16];
co3 = {"A", "B", "C", "D", "E", "F"};

laList = Join[{co1}, {co2}, {co3}] // Transpose;

laListGraph = Grid[laList,
Dividers -> All,
Alignment -> {Left, Center},
ItemSize -> Automatic,
ItemStyle -> Directive[FontSize -> 14, Black, Italic, Bold],
Spacings -> {2, 1},
Background -> {None, None, {
{{1, 3}, {1, 3}} -> LightRed,
{{4, 6}, {1, 3}} -> LightBlue
} } ]

最佳答案

编辑:

再想一想,我之前的内容不是您想要的...您希望它显示为列,但后半行拆分并显示在第一行旁边。下面的代码应该做到这一点。让我知道这是否是您的想法...

(Grid[#1, Dividers -> All, Alignment -> {Left, Center}, 
ItemSize -> Automatic,
ItemStyle -> Directive[FontSize -> 14, Black, Italic, Bold],
Spacings -> {2, 1},
Background -> {None,
None, {{1, 3}, {1, 3}} -> #2}] &) @@@ {{laList[[;; 3, All]],
LightRed}, {laList[[4 ;;, All]], LightBlue}} // Row

enter image description here

关于graphics - 在 Mathematica 中排列和显示网格的各个部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6133617/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com