0

How can I maximise the size of the bottom of the figure when I am using landscape as the figure shown below:

The circle area have a large empty area where I want to maximise the image.

enter image description here

\documentclass[12pt,oneside]{book}  % Remove draft option to show figures (for final draft), otherwise keep for faster production

\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{textcomp}
\usepackage{subcaption}
\usepackage{graphicx}

\usepackage[hypcap=false]{caption}
\usepackage[list=true]{subcaption}

\usepackage[most]{tcolorbox}

\usepackage{enumitem} % macros to modify appearance 

\usepackage[backend=biber, 
% style=authoryear, 
 style=authoryear-comp,
% citestyle=authoryear, 
dashed=false,
maxcitenames=2,
maxbibnames=99,
uniquelist=false, % for Author1 et al. (year) instead of Author1, Author2 et al. (year)
giveninits,
alldates=comp, %for online citing
dateabbrev=false, %for online citing for data format month in full
uniquename=init]{biblatex}

\makeatother
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\usepackage{lipsum} % for filler text

\usepackage{graphicx}
\usepackage[export]{adjustbox}

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{uorthesis}
  [2018/01/18 v0.01 LaTeX package for UOR thesis]

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[english]{babel} %keep english format as babel for date ciitng format
\usepackage{graphicx}
\usepackage{enumitem}
\setlist{nosep} % Removes too much vertical spacing in lists
\usepackage{booktabs}           % makes tables look good
\usepackage{fancyhdr}           % For page number in the upper right (required) and other running headers(optional)
\usepackage{setspace}           % For double-spacing (required)
\usepackage{titlesec}           % For keeping chapter/chapter titles single-spaced
\usepackage{etoolbox}           % For the flag determining if front matter goes into the TOC
\usepackage{float}              % Helps float images to the top
\RequirePackage{xcolor}

\definecolor{darkblue}{rgb}{0, 0, 0.5}
\usepackage[colorlinks=true, allcolors=darkblue]{hyperref}           % Adds hyperlinks in the pdf

\usepackage[font=small,labelfont={bf,sf}, textfont={sf}, justification=centering]{caption}
\usepackage{hyperref}

\usepackage{helvet}

% Header height (to avoid fancyhdr error)
\setlength{\headheight}{13.6pt}

% Header formatting for regular pages
\fancyhf{}
\fancyhead[L]{\it\small\leftmark}
\fancyhead[R]{\small\thepage}

% Header formatting for chapter title pages
\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyhead[R]{\small\thepage}
  \renewcommand{\headrulewidth}{0pt}
}
% Formatting of chapter and chapter titles: keep them single-spaced in the midst of double-spaced text
\usepackage{sectsty}
\titleformat{\chapter}[hang]{\Huge\sffamily\bfseries}{\thechapter{. }}{0pt}{\Huge}
\allsectionsfont{\normalfont\sffamily\bfseries}
% \usepackage{subfigure}
% \usepackage[subfigure]{tocloft} % subfigure option only if using subfigure package
% \renewcommand{\cfttoctitlefont}{\Huge \bfseries \sffamily} % ToC title

\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\Huge \bfseries \sffamily}
\setcounter{lofdepth}{2}    % added in for to put subfigure in List of Figure https://tex.stackexchange.com/questions/522538/tocloft-does-not-work-with-list-of-subfigure-in-list-of-figure/522540?noredirect=1#comment1321553_522540 and https://tex.stackexchange.com/questions/522536/why-tcolorbox-crash-with-caption

\addto\captionsenglish{
\renewcommand{\listfigurename}{\textsf{List of Figures}}
\renewcommand{\listtablename}{\textsf{List of Tables}}
}

% Flag for whether to add front matter to TOC
\newtoggle{fulltoc}
\toggletrue{fulltoc}  % Change to \togglefalse{fulltoc} to remove front matter
\renewcommand{\contentsname}{Table of Contents}


\begin{document}

% Title page
\include{structure/title}

% All subsequent pages must be numbered, title page is considered page i,
% front matter is numbered in lowercase Roman numerals
\pagestyle{fancy}
\pagenumbering{roman}
\setcounter{page}{2}
\doublespacing

% Table of Contents, List of Tables, List of Figures
\tableofcontents

\clearpage
\setcounter{page}{0}
\pagenumbering{arabic}

% Body


%   \include{chapters/01-introduction}

\chapter{Introduction}
\label{chap:introduction}

\setlength{\parindent}{0pt} %disable auto indentation




\section{Motivation}
Lorem Ipsum

Lorem Ipsum

Lorem Ipsum

Lorem Ipsum

Lorem Ipsum

Lorem Ipsum

Lorem Ipsum


\begin{figure}[!b]
        \centering
            % \includegraphics[width=\textwidth]
               \includegraphics[scale=1]{example-image}
            \subcaption{$Q^{*}$ values for arm 1}
            \label{fig:arm1}
          \end{figure}
    %

\begin{sidewaysfigure}
        \centering
   \includegraphics[scale=1.7]{example-image}
            \caption{$Q^{*}$ values for arm 1}
            \label{fig:arm1}
          \end{sidewaysfigure}

\begin{landscape}
\begin{figure}
        \centering
                \includegraphics[scale=1.7]{example-image}
            \caption{$Q^{*}$ values for arm 1}
            \label{fig:arm1}
          \end{figure}
    \end{landscape}


\clearpage
\pagebreak

\begin{figure}[htb]
\centering
  \begin{tabular}{@{}c@{}}
    \includegraphics[scale=0.85]{example-image}\\
    \includegraphics[scale=0.85]{example-image} \\
    \includegraphics[scale=0.85]{example-image}
  \end{tabular}
    \caption{Structure of the three studies in this work}
    \label{fig:Structure of the three studies in this work}
\end{figure}

\clearpage
\pagebreak



\end{document}
aan
  • 2,663
  • [width=\linewidth] should work in either case but your image shows that the height of the image rather than the width is going to be the constraining factor here as you want to preserve aspect ratio – David Carlisle Jan 05 '20 at 14:51
  • @DavidCarlisle, thanks. \includegraphics[width=\linewidth,scale=1.7]{example-image}. Can we change height? – aan Jan 05 '20 at 15:14
  • remove the scale option that is completely over-riding the width specification, yes you can specify height= see the graphicx package documentation. – David Carlisle Jan 05 '20 at 15:17
  • @DavidCarlisle Thanks. I tried this \includegraphics[height=14.5cm]{example-image} and \includegraphics[scale=1.7]{example-image} looks similar size. If I make the height larger than 1.45cm, it will cover the header and page number. – aan Jan 05 '20 at 15:28

1 Answers1

2

Scaling immage can lead to the problems with which you are now faced, Beter is accomodate their size to available space on the page, for example to \textwidth, or \textheight or to fraction of both. if you define width of image, can happen that its height is to big and consequently protrude text border. This depends on images size ratios.

After making your MWE real MWE (removing all not used packages from preamble), you can use for your test the following MWE:

\documentclass[12pt,oneside]{book}  % Remove draft option to show figures (for final draft), otherwise keep for faster production

\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{textcomp}
\usepackage{subcaption}
\usepackage{graphicx}

\usepackage[hypcap=false]{caption}
\usepackage[list=true]{subcaption}

\usepackage[most]{tcolorbox}

\usepackage{enumitem} % macros to modify appearance

\usepackage[backend=biber,
% style=authoryear,
 style=authoryear-comp,
% citestyle=authoryear,
dashed=false,
maxcitenames=2,
maxbibnames=99,
uniquelist=false, % for Author1 et al. (year) instead of Author1, Author2 et al. (year)
giveninits,
alldates=comp, %for online citing
dateabbrev=false, %for online citing for data format month in full
uniquename=init]{biblatex}

\makeatother
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\usepackage{lipsum} % for filler text
\usepackage[demo,
            export]{adjustbox}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{setspace}       % For double-spacing (required)
\usepackage{etoolbox}       % For the flag determining if front matter goes into the TOC
\setlength{\parindent}{0pt} %disable auto indentation

\usepackage{rotating}
\usepackage{pdflscape}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}

\begin{document}
\chapter{Introduction}
\section{Motivation}
\lipsum[1]
    \begin{figure}[!b]
    \centering
\includegraphics[width=\linewidth]{example-image}
    \caption{$Q^{*}$ values for arm 1}
    \label{fig:arm1}
    \end{figure}

\begin{sidewaysfigure}[htp]
    \centering
\includegraphics[width=\linewidth]{example-image-16x9}
    \caption{$Q^{*}$ values for arm 1}
    \label{fig:arm1}
\end{sidewaysfigure}


\begin{landscape}
    \begin{figure}[p]
    \centering
\includegraphics[width=\linewidth, height=0.6\linewidth]{example-image-b}
    \caption{$Q^{*}$ values for arm 1}
    \label{fig:arm1}
    \end{figure}
\end{landscape}

\begin{figure}[htbp]
    \centering
\includegraphics[height=0.3\textheight]{example-image}\\[1ex] 
\includegraphics[height=0.3\textheight]{example-image}\\[1ex] 
\includegraphics[height=0.3\textheight]{example-image}
    \caption{Structure of the three studies in this work}
    \label{fig:Structure of the three studies in this work}
\end{figure}
\end{document}

As you can see, no image is smaller than will left white space in bot direction of text area nor bigger that will protrude text borders:

enter image description here enter image description here

(red lines indicate page layout)

Zarko
  • 296,517
  • thanks. Can i know width=\linewidth, height=0.6\linewidth will make the width and height increase together (meaning: image size is increase both in width and height together, rather than just one side). Basically, I want to have the image in good scaling like original image (without large in one side only) – aan Jan 05 '20 at 16:15
  • @ann, that is up to you. I would rather preserve aspect ratio. This means, that it can happen, that image will not cover whole text area but only one direction (anyway, you should left fraction of it for image caption. – Zarko Jan 05 '20 at 16:33
  • thanks a lot. I am very confused. width=\linewidth, height=0.6\linewidth for is scaling only one direction (either width or height); and \includegraphics[scale=1.7]{example-image} is scalling in aspect ratio equally in both direction. Am I correct? – aan Jan 05 '20 at 17:46