2

I wish to put the caption of a rotated figure underneath the figure, rather than at the bottom of the page.

Here is my code:

\documentclass{article}
\usepackage{array,ragged2e,titlesec}
\usepackage[demo]{graphicx}
\usepackage{rotating}
\usepackage{caption}

\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}

\titleformat{\section}
  {\normalfont\fontsize{14}{12}\bfseries}{\thesection}{1em}{}
\makeatletter
\renewcommand{\paragraph}{%
  \@startsection{paragraph}{4}%
  {\z@}{1.2ex \@plus 1ex \@minus .2ex}{-1em}%
  {\normalfont\normalsize\bfseries}%
}
\renewcommand{\baselinestretch}{1.0}
\makeatother
\setcounter{secnumdepth}{3}


\begin{document}

\begin{figure}
    \centering
        \includegraphics[angle=270,scale=0.6]{figure.eps}
    \caption{text here}
    \label{fig:}
\end{figure}


\end{document}

thanks! Michael

  • Welcome to TeX.SE! I've taken the liberty of adding a couple of instructions -- specifically, \documentclass{article} and \usepackage{array,ragged2e,titlesec} -- to make your code compilable. – Mico Sep 14 '14 at 13:45
7

Since you're loading the rotating package, I assume you're interested in using that package's sidewaysfigure environment. This environment behaves very much like the regular figure environment, except that it's rotated 90 degrees counterclockwise (at least when used in a "standard" setup of the article document class). Note also that there can be only one sidewaysfigure per page; however, each sidewaysfigure could contain several images, each with its own \caption and \label.

Here's a modified form of your code; the main modification is the replacement of figure with sidewaysfigure. You'll see I've also commented out most of the preamble code as it's not relevant for the issue at hand.

enter image description here

\documentclass{article}
\usepackage[demo]{rotating}

%% Commented out the rest of the preamble ...

%\usepackage{array,ragged2e,titlesec}
%\usepackage[demo]{graphicx}
%\usepackage{caption}
%\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
%\titleformat{\section}
%  {\normalfont\fontsize{14}{12}\bfseries}{\thesection}{1em}{}
%\makeatletter
%\renewcommand{\paragraph}{%
%  \@startsection{paragraph}{4}%
%  {\z@}{1.2ex \@plus 1ex \@minus .2ex}{-1em}%
%  {\normalfont\normalsize\bfseries}%
%}
%\renewcommand{\baselinestretch}{1.0}
%\makeatother
%\setcounter{secnumdepth}{3}

\begin{document}
\begin{sidewaysfigure}
    \centering
        \includegraphics[width=\textwidth]{figure.eps}
    \caption{text here}
    \label{fig:a}
\end{sidewaysfigure}
\end{document}
2

May be like this:

\documentclass{article}
\usepackage{graphicx}
\usepackage[figuresleft]{rotating}
\usepackage{caption}

\begin{document}
Some text here

\begin{figure}[htb]
    \centering
    \begin{turn}{-90}
    \begin{minipage}{3in}
    \centering
        \includegraphics[width=\linewidth]{example-image-a}
    \caption{text here}
    \label{fig:yours}
    \end{minipage}
    \end{turn}
\end{figure}

\begin{sidewaysfigure}
    \centering
        \includegraphics[scale=0.6]{example-image-a}
    \caption{text here}
    \label{fig:mine}
\end{sidewaysfigure}

Some other things here


\end{document}

enter image description here

You can also use rotatebox macro from graphicx:

\begin{figure}[htb]
    \centering
    \rotatebox[origin=c]{-90}{%
    \begin{minipage}{3in}
    \centering
        \includegraphics[width=\linewidth]{example-image-a}
    \caption{text here}
    \label{fig:yours}
    \end{minipage}
    }
\end{figure}

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.