2
$\begingroup$

This question already has an answer here:

Here is the output of PointLegend:

a = {"a", "ai", "an", "ang", "ao", "b", "c", "ch", "d", "e", "ei", "en", "eng", "er", "f", "g", "h", "i", "ia", "ian", "iang", "iao", "ie", "ii", "iii", "in", "ing", "iong", "iou", "j", "k", "l", "m", "n", "o", "ong", "ou", "p", "q", "r", "s", "sh", "sil", "sp", "t", "u", "ua", "uai", "uan", "uang", "uei", "uen", "ueng", "uo", "v", "van", "ve", "vn", "x", "z", "zh"}; 

PointLegend["Rainbow", a, LegendMarkerSize -> 15, LegendLayout -> "Column"]

enter image description here

It's like a 9*7 matrix, how to reshape it? like 5*13.

I find the Head of the result is still PointLegend.So Can't using List method to reshape it.

However I found If changing LegendLayout to LegendLayout -> "Automatic". It seems it construct from the List

enter image description here

$\endgroup$

marked as duplicate by Lukas Lang, Community Jan 15 at 8:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5
$\begingroup$
PointLegend["Rainbow", a, LegendMarkerSize -> 15, 
 LegendLayout -> {"Row", 5}]

enter image description here

Alternatively,

PointLegend["Rainbow", a, LegendMarkerSize -> 15, 
 LegendLayout -> (Grid[Row /@ # & /@ Partition[#, 13, 13, 1, {}], 
     Alignment -> Left] &)]

enter image description here

$\endgroup$
  • $\begingroup$ Wow, It's a undocumented trick!Thanks! $\endgroup$ – partida Jan 15 at 8:47

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