Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Please I need someone to help me address this problem.

I have three graphs that I created using excel and I have been able to save them as eps files. I've been able to use the \raisebox command to arrange the graphs in the order I want but adding the axis title has being a big problem for me. Please find attached a picture showing what I need to achieve. I have also included a working extract of my code.

Task

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\newsubfloat{figure}
\begin{document}
\begin{figure}[htb]
  \centering
  \raisebox{\dimexpr-.5\height-1em}{\includegraphics[scale=0.4]{Figures/knockho1.eps}}\ \subfloat[\label{label1}]{} \\[\topskip]
  \raisebox{\dimexpr-.5\height-1em}{\includegraphics[scale=0.4]{Figures/knockho2.eps}}\ \subfloat[\label{label2}]{}
  \caption{This is the text that describes \protect\subref{label1} and \protect\subref{label2}.}
\end{figure}
\end{document}
share|improve this question
add comment

2 Answers 2

One way to do this would be to define a minipage to contain the y-axis, and simply place the text for the x-axis with an appropriate \hspace*{} preceding it.

enter image description here

Code:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{xcolor}

\newsubfloat{figure}
\begin{document}
\begin{figure}[htb]
\begin{minipage}{0.5cm}
\rotatebox{90}{\textcolor{red}{$y$-axis label}}
\end{minipage}%
\begin{minipage}{\dimexpr\linewidth-2.50cm\relax}%
  \raisebox{\dimexpr-.5\height-1em}{\includegraphics[scale=0.4]{Figures/knockho1.eps}}\ \subfloat[\label{label1}]{} \\[\topskip]
  \raisebox{\dimexpr-.5\height-1em}{\includegraphics[scale=0.4]{Figures/knockho2.eps}}\ \subfloat[\label{label2}]{}

  \vspace*{0.1cm}\hspace*{2.0cm}\textcolor{red}{$x$-axis label}
  \caption{This is the text that describes \protect\subref{label1} and \protect\subref{label2}.}
\end{minipage}%
\end{figure}
\end{document}
share|improve this answer
    
Thanks so much Peter. You answer was nice except that the labels (a) and (b) are now below the figures instead of staying at the sides of the figures when I executed your code. Please help me to correct this. The vertical space consumed is very important to me. –  Fizzle Dec 20 '12 at 17:25
    
@Fizzle: As per the image above, when I compile the example, the labels are not below, but on the sides. So, without a complete example that reproduces the problem not sure how I can diagnose the issue you are experiencing. Putting the code into a minipage should not have any effect on the labels positions (except that they not need to fit into a narrower page). –  Peter Grill Dec 20 '12 at 17:31
    
Thank you Peter. I have been able to detect the problem at my end. The scale I was using was too high hence the problem. Thanks once again!! –  Fizzle Dec 20 '12 at 20:28
add comment

I have a slightly different solution:

\documentclass[draft]{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[htb]
\centering
\hspace*{1.5em}\raisebox{\dimexpr-.5\height-1em}
  {\includegraphics[scale=0.4]{Figures/knockho1.eps}}%
\subfloat[\label{label1}]{\hspace{1.5em}}
\\[\medskipamount]
\hspace*{1.5em}\raisebox{\dimexpr-.5\height-1em}
  {\includegraphics[scale=0.4]{Figures/knockho2.eps}}%
\subfloat[\label{label2}]{\hspace{1.5em}}

\leavevmode\smash{\makebox[0pt]{\hspace{17em}% HORIZONTAL POSITION           
  \rotatebox[origin=l]{90}{\hspace{2em}% VERTICAL POSITION
    Some text that should go at the side}%
}}\hspace{0pt plus 1filll}\null

Some text that should go below

\medskip

\caption{This is the text that describes \protect\subref{label1} and \protect\subref{label2}.}
\end{figure}
\end{document}

You can work on the distances next to VERTICAL and HORIZONTAL for fixing the position of the rotated label.

Usual caveat: the demo option to graphicx is just to make the example. In general, however, it's better to specify the width of the figures, rather than the scale factor.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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