1

I have an image that consists on several subimages stiched together. I would like to add row and column labels to the subimages. How would I do that?

\documentclass[11pt]{report}

\usepackage{graphicx} %for including eps graphics

\begin{document}

\begin{figure}
\begin{center}
\includegraphics{image.png} 
\end{center}
\caption{Some text } 
\end{figure}


\end{document}

Essentially, my image is similar to the one in the following picture and I would like to add the text that is in red. Potentially it would be nice to have the text1 text2 be rotated 90 degrees.

enter image description here

4
  • Are the subimages in your image of equal sizes? – Troy May 10 '17 at 9:41
  • @Troy Each subimage is MxN, but all subimages have the same size. – Ander Biguri May 10 '17 at 9:42
  • Would it be possible to split the picture into 4 pictures? This would make it easier. – Georg May 10 '17 at 9:51
  • @Georg I woudl like to avoid manually splitting the pictures myself, as I may have quite a decent amount of them. A solution on where Latex splits the PxQ subfigures "automatically" (by cropping or whatever) is something that I would be also happy with. – Ander Biguri May 10 '17 at 9:58
3

Probably there are better solutions, but with TikZ you can do it:

\documentclass[11pt]{report}

\usepackage{graphicx} %for including eps graphics
\usepackage{tikz}

\begin{document}

\begin{figure}
\centering

\begin{tikzpicture}
\node (A) {\includegraphics[width=5cm]{example-image}};
\path (A.south west) -- (A.north west) node[pos=.25, above, rotate=90] {Text 2} node[pos=.75, above, rotate=90] {Text 1};
\path (A.south west) -- (A.south east) node[pos=.25, below] {(a)} node[pos=.75, below] {(b)};
\end{tikzpicture}

\caption{Some text } 
\end{figure}


\end{document}

enter image description here

1
  • Brilliant! Easy to use and neat. – Ander Biguri May 11 '17 at 8:59
1
\documentclass[11pt]{report}
\usepackage[english]{babel}
\usepackage{graphicx} %for including eps graphics

\begin{document}

\begin{figure}


 \begin{minipage}{2mm}
 \rotatebox{90}{\hspace{50mm}Text-1}
 \end{minipage}
 \begin{minipage}{2mm}
\includegraphics[scale=0.8]{1.png} 
\end{minipage}

\begin{minipage}{2mm}
\vspace*{-120mm}
\rotatebox{90}{\hspace*{-25mm}Text-2}
\end{minipage}

\caption{Some text } 

\end{figure}


\end{document}

enter image description here

2
  • I think the question is to apply the captions/text to a single image, judging from the title and the MWE – Troy May 10 '17 at 9:38
  • Indeed, the question is about a single image. – Ander Biguri May 10 '17 at 9:39

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.