3
$\begingroup$

I am trying to plot three panels side-by-side with

Partition[
  Table[
    Panel[panellist[[i]], 
      Style[CharacterRange["A", "C"][[i]], 17], {{Left, Top}}, 
      Background -> White, FrameMargins -> 0, ImageMargins -> 10, 
      ImageSize -> {300, 300}, Appearance -> Frameless], 
    {i, 1, 3}], 
  3]

where panellist is a list of 3 plots. I want to include reference letters (A-C), but the alignment {Left,Top} ends up placing the letter too much to the left. How can I give explicit coordinates here?

$\endgroup$
  • $\begingroup$ can you try if replacing ImageMargins->10 with FrameMargins -> {{-10, 10}, {10, -5}} give what you need? $\endgroup$ – kglr Oct 5 '18 at 17:22
2
$\begingroup$

Here is one of many ways to accomplish what I think you want. For what it lacks in elegance, it makes up with simplicity.

panellist = Table[Plot[Sin[2 Pi i x], {x, 0, 1}], {i, 3}];
labels = Style["     " <> #, 17] & /@ {"A", "B", "C"};
Row[
  Table[
    Column[{
      labels[[i]],
      Panel[panellist[[i]],
        Background -> White,
        FrameMargins -> 0,
        ImageMargins -> 10,
        ImageSize -> {300, 200},
        Appearance -> Frameless]}],
    {i, 3}]]

plots

You can shift the characters in the labels by adding or subtracting spaces in the 1st argument of the Style expression used in labels.

Edit

If you would prefer to have the labels inside the panels, that can be accommodated with this variant:

labels = Style["       " <> #, 16] & /@ {"A", "B", "C"};
Row[
  Table[
    Panel[Column[{labels[[i]], panellist[[i]]}],
      Background -> White,
      FrameMargins -> 0,
      ImageMargins -> 5,
      ImageSize -> 200],
  {i, 3}]]

plots

| improve this answer | |
$\endgroup$
2
$\begingroup$

You can wrap the labels in Pane and use ImageMargins with a negative value for the right margin:

panellist = Plot[Sin[# x], {x, -Pi, Pi}] & /@ Range[3];
Table[Panel[panellist[[i]], 
   Pane[Style[CharacterRange["A", "C"][[i]], 17], 
       Alignment -> {Center, Right}, ImageSize -> {50, Full},
       ImageMargins -> {{0, -35}, {0, 10}}], 
   {{Left, Top}}, 
   Background -> White, FrameMargins -> 0, ImageMargins -> 10, 
   ImageSize -> {300, 300}, Appearance -> Frameless], {i, 1, 3}]

enter image description here

| improve this answer | |
$\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.