0
$\begingroup$

I'm curious about the following: if I want to make a table described by the following code,

TableForm[
    Table[Plot[Sin[ n x], {x, 0, 2 Pi}, ImageSize -> {150, 150}], {n, 1, 
15}]
]

How will I be able to arrange it into a 3 by 5 table instead of a 1 by 15?

$\endgroup$
  • 1
    $\begingroup$ Multicolumn[ Table[Plot[Sin[n x], {x, 0, 2 Pi}, ImageSize -> {150, 150}], {n, 1, 15}], 5] Or Multicolumn[ Table[Plot[Sin[n x], {x, 0, 2 Pi}, ImageSize -> {150, 150}], {n, 1, 15}], 5, Appearance -> "Horizontal"] $\endgroup$ – Okkes Dulgerci May 18 at 23:13
  • $\begingroup$ Thank you this is good! Also the previous answer using Partition[table,3] works great as well. $\endgroup$ – Houndbobsaw May 19 at 0:40
1
$\begingroup$

Given your table

table = Table[Plot[Sin[n x], {x, 0, 2 Pi}, ImageSize -> {150, 150}], {n, 1, 15}];

Here are three different ways to do it,

TableForm[ArrayReshape[table, {3, 5}]]

Multicolumn[table, {3, 5}]

Grid[Partition[table, 5]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.