I'd like to add a label to the top of each column of a GraphicsGrid and to the Left of each Row.

This prior question does not seem to allow rotating the row label.

The Row labels need to be rotated, so the TableForm does not suffice, anyway I also need these to be graphics objects for exporting.

Given is the example output generated below, where the GraphicsGrid is what I am working with:

pl = Table[ListPlot[RandomReal[{0, 1}, 60]], {4}, {6}];

(*Nearly but not rotated*)
TableForm[pl, TableHeadings -> {{"r1 rotated", "r2 rotated", "r3 rotated", "r4 rotated"}, {"c1", "c2", "c3", "c4", "c5", "c6"}}]

(* Ideal if labels added to this *)

Appreciate any hints or tips.

  • 4
    $\begingroup$ why not TableHeadings -> {Rotate[#, 90 Degree] & /@ {"r1 rotated", "r2 rotated", "r3 rotated", "r4 rotated"}, {"c1", "c2", "c3", "c4", "c5", "c6"}}? $\endgroup$ – kglr Dec 29 '17 at 2:21
  • $\begingroup$ That did the trick. If you want to post the comment as an answer I'll accept it. Otherwise I'll answer with your suggestion if you don't object? $\endgroup$ – Hedgehog Dec 31 '17 at 3:47
  • $\begingroup$ Hedgehog, posted an answer. $\endgroup$ – kglr Dec 31 '17 at 3:59
pl = Table[ListPlot[RandomReal[{0, 1}, 60]], {3}, {4}];
TableForm[pl, TableHeadings -> 
   {Rotate[#, 90 Degree] & /@ {"r1 rotated", "r2 rotated", "r3 rotated", "r4 rotated"}, 
   {"c1", "c2", "c3", "c4", "c5", "c6"}},
  TableAlignments -> Center]

enter image description here


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.