Skip to main content

graphics - Label or index images


Question:


How can I index (like in the example below: "c" and "d") images outside the frame?


enter image description here


I started to code, but I got stuck in the lack of documentation:



state0 = Import[
"d:\\bitbucket\\monte-carlo-borderline\\pics\\torus-0-l5.png"]
state3 = Import[
"d:\\bitbucket\\monte-carlo-borderline\\pics\\torus-3-l5.png"]
GraphicsGrid[{{state0, state3}}, Spacings -> {1, 2}, Frame -> All]

Input images:


enter image description hereenter image description here


Part-result:


enter image description here




Answer



states = {state0, state1, ImageMultiply[state0, Red], ImageMultiply[state0, Yellow]};
labels = {"(a)", "(b)", "(c)", "(d)"};

Labeled


Grid[Partition[Labeled[Show[#, ImageMargins -> {{30, 0}, {0, 0}}], 
Style[#2, 16], {{Top, Left}}] & @@@
Transpose[{states, labels}], 2], Spacings -> 5]

enter image description here



Legended


Grid[Partition[Legended[Show[#, ImagePadding -> {{40, 0}, {0, 40}}], 
Placed[Style[#2, 16], {{0, 1}, {1.1, 0}}]] & @@@
Transpose[{states, labels}], 2], Spacings -> 1]

enter image description here


Comments