0

I am entering a triple-figure like so:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[autostyle, english = american]{csquotes}
\usepackage{natbib}
\usepackage{url}
\usepackage[utf8x]{inputenc}
\usepackage[tbtags]{amsmath}
\usepackage{graphicx}
\usepackage{subcaption}
\graphicspath{{images/}}
\usepackage{parskip}
\usepackage{fancyhdr}
\usepackage{vmargin}
\usepackage{braket}
\usepackage{enumerate}
\usepackage{lipsum}
\setmarginsrb{3 cm}{2.5 cm}{3 cm}{2.5 cm}{1 cm}{1.5 cm}{1 cm}{1.5 cm}

\begin{document}

\begin{figure}
    \centering
    \begin{subfigure}[t]{0.72\textwidth}
        \centering
        \includegraphics[width=0.72\textwidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass1.png}
        \caption{$M\in (3, 4]\times 10^{14}$Msol/h}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.72\textwidth}
        \centering
        \includegraphics[width=0.72\textwidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass2.png}
        \caption{$M\in (4, 5]\times 10^{14}$Msol/h}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.72\textwidth}
       \centering
       \includegraphics[width=0.72\textwidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass3.png}
        \caption{$M>5\times 10^{14}$Msol/h}
\end{subfigure}
\caption{Derivatives of the tangential shear profiles with respect to the matter fluctuation parameter.}
\end{figure}

\end{document

Here is what comes out: enter image description here

As you can see, the label on the y-axis is cut off. How can I modify the code to widen the horizontal scope that is allowed?

5
  • @Bobyandbob What is MWE? and what is a tikz code?
    – ODP
    May 18 '17 at 21:29
  • And I don't know what you mean by "The original images .PNG are okay?"... what do you mean are they okay?
    – ODP
    May 18 '17 at 21:30
  • (i) with fbox{ \includegraphics[width=0.72\textwidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass1.png}} look, if around your image is white space. If it is, remuve them with trim option in \includegraphics or better in program, which is image source (this is test, if your images are OK :)); (ii) increase width of image with \includegraphics[width=\textwidth].
    – Zarko
    May 18 '17 at 21:50
  • @Zarko Thanks, maybe post as an answer?
    – ODP
    May 18 '17 at 21:52
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. See how to create a minimal working example (MWE).
    – ebosi
    May 18 '17 at 22:02
1

We haven't data/information about your images nor Minimal Working Example (MWE), by which we can search for cause of your problem. Based on guessing:

  • Maybe your images has white space around it. To see, if this is a case, make the with including your images in \fbox{...}, for example:

\fbox{ \includegraphics[width=0.72\textwidth]{/Users/Olly/Documents‌​/FINALVALUES/Plots/D‌​erivatives/mass1.png‌​}}

If you will see white space around image, you can remove it with trim option \includegraphics[trim= ...] or better in program by which images are generated [this is test, if your images are OK :)]

  • increase image size with enlarge image width with

\includegraphics[width=\textwidth]{...}

  • from your code snipped can be concluded, that you like to have all images in one line, but you set sub-figure width equal to 0.7\textwidth. Consequently image cannot be placed in one row ... this make your question even more confusing:

Test of your code snipped demo option of graphicx package with two selection of images width gives:

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

%---------------------------------------------------------------%
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%


\begin{document}
Images are in one row:
\begin{figure}[!ht]
    \centering
    \begin{subfigure}[t]{0.3\textwidth}
        \centering
        \includegraphics[width=\linewidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass1.png}
        \caption{$M\in (3, 4]\times 10^{14}$Msol/h}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.3\textwidth}
        \centering
        \includegraphics[width=\linewidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass2.png}
        \caption{$M\in (4, 5]\times 10^{14}$Msol/h}
    \end{subfigure}
    \hfill
    \begin{subfigure}[t]{0.3\textwidth}
       \centering
       \includegraphics[width=\linewidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass3.png}
        \caption{$M>5\times 10^{14}$Msol/h}
\end{subfigure}
\caption{Derivatives of the tangential shear profiles with respect to the matter fluctuation parameter.}
\end{figure}

Images are spread over three rows:
\begin{figure}[!hb]
    \centering
    \begin{subfigure}[t]{\textwidth}
        \centering
        \includegraphics[width=\linewidth,height=0.2\linewidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass1.png}
        \caption{$M\in (3, 4]\times 10^{14}$Msol/h}
    \end{subfigure}

    \begin{subfigure}[t]{\textwidth}
        \centering
        \includegraphics[width=\linewidth,height=0.2\linewidth] {/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass2.png}
        \caption{$M\in (4, 5]\times 10^{14}$Msol/h}
    \end{subfigure}

    \begin{subfigure}[t]{\textwidth}
       \centering
       \includegraphics[width=\linewidth,height=0.2\linewidth]{/Users/Olly/Documents/FINALVALUES/Plots/Derivatives/mass3.png}
        \caption{$M>5\times 10^{14}$Msol/h}
\end{subfigure}
\caption{Derivatives of the tangential shear profiles with respect to the matter fluctuation parameter.}
\end{figure}
\end{document}

Red frame (produced by package showframe) show page layout. In real document it had to be removed.

4
  • I have provided an MWE now. I have tried your suggestions but the label on the y-axis is still being cut off. The label on the x-axis also gets cut off if I make the text larger.
    – ODP
    May 19 '17 at 14:26
  • I have also tried to make the margin size smaller, but this doesn't work.
    – ODP
    May 19 '17 at 14:28
  • @ODP, than you have problem with images. please. provide images somewhere where I can download them.
    – Zarko
    May 19 '17 at 15:06
  • @ODP, any news?
    – Zarko
    May 20 '17 at 19:49

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.