2

I have this figure which only fits in landscape mode. However, it my current settings it appears too small (see Figure). Can anyone help me maximi

Figure is too small!

I am using this code:

\begin{landscape}
    \begin{figure}[p]
        \centering
        \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{ch6/poaf_dt.pdf}
        \caption{Decision-tree used to predict postoperative atrial fibrillation.}
        \label{fig:poad_dt}
    \end{figure}
\end{landscape}

Many thanks!

  • 1
    Use width=\linewidth and height=.85\textwidth (you need vertical space for the caption). Or you can load package scrhack and use width=\textheight, height=.85\textwidth. – esdd Sep 30 '18 at 14:24
  • It works :) can u please post this as an answer so that I mark it done? – Take2 Sep 30 '18 at 14:35
3

In landscape environment you have to use eg height=.9\textwidth to ensure there is vertical space for the caption.

Unfortunaly you can not use width=\textheight because landscape changes it to the same value as \textwidth. So you have to use width=\linewidth.

Example:

\documentclass{article}
\usepackage{showframe}% to show the page layout
\usepackage{graphicx}
\usepackage{pdflscape}
\begin{document}
Text
\begin{landscape}
    \begin{figure}[p]
        \centering
        \includegraphics[width=\linewidth,height=.9\textwidth
        %,keepaspectratio% commented for the example
        ]{example-image}
        \caption{Decision-tree used to predict postoperative atrial fibrillation.}
        \label{fig:poad_dt}
    \end{figure}
\end{landscape}
\end{document}

Result:

enter image description here

With package scrhack you can use width=\textheight and showframe shows the correct page layout:

\documentclass{article}
\usepackage{scrhack}
\usepackage{showframe}% to show the page layout
\usepackage{graphicx}
\usepackage{pdflscape}
\begin{document}
Text
\begin{landscape}
    \begin{figure}[p]
        \centering
        \includegraphics[width=\textheight,height=.9\textwidth
        %,keepaspectratio% commented for the example
        ]{example-image}
        \caption{Decision-tree used to predict postoperative atrial fibrillation.}
        \label{fig:poad_dt}
    \end{figure}
\end{landscape}
\end{document}

enter image description here

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.