# Figure in landscape mode is too small

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

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.}
\end{figure}
\end{landscape}


Many thanks!

• 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? Sep 30 '18 at 14:35

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.}
\end{figure}
\end{landscape}
\end{document}


Result:

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.}