1

I have three graphs together on a page:

\documentclass[a4paper, 12pt]{article}

\usepackage{ifpdf}
\usepackage[latin1]{inputenc}
\usepackage[margin=2cm, left=2cm, top = 1.7cm, bottom=1.7cm]{geometry}
\usepackage{amsmath, mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{epigraph}
\usepackage{wasysym}
\usepackage[none]{hyphenat}
\usepackage[super]{nth}
%\usepackage{subfig}
\usepackage{textcomp}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{hyperref}
\usepackage[authoryear, super]{natbib}
\usepackage{comment}
\usepackage{setspace}
\usepackage{float}
\usepackage{dcolumn}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage{gensymb}

\begin{document}
\begin{figure}[htp]

    \centering
    \includegraphics[width=.32\linewidth]{"../../Graphs for Jan/graph_left"}
    \includegraphics[width=.32\linewidth]{"../../Graphs for Jan/graph_middle"}
    \includegraphics[width=.32\linewidth]{"../../Graphs for Jan/graph_right"}

    \caption[Fit for different redshift ranges]{The best fits for each redshift range, $ (U-K)/(W2-NUV) $ for $ z<1 $ (left), $ (I-W2)/(W3-U) $ for $ 1<z<3 $ (middle) and $ (I-SPIT8)/(W4-R) $ for $ z>3 $ (right).}
    \label{fig:3graphs}

\end{figure}
\end{document}

enter image description here

but I'd like them to have as little whitespace between them as possible, and to go outside the margins if necessary. I don't need them as subfigures, they function as one graph (i.e. the red one goes from 0<x<1, green from 1<x<3, blue from 3<x. How can I get them closer together?

1
  • 1) If the images are PDFs, then pdfcrop might be a very useful tool. 2) Use 0.333 and not 0.32 of \linewidth. Jul 3, 2019 at 6:26

2 Answers 2

2

I changed your used images to example-image-a etc. from package mwe which must be installed, but not called ...

Now please see the following corrected and shortend mwe:

\documentclass[a4paper, 12pt]{article}

\usepackage[latin1]{inputenc}
\usepackage[margin=2cm, left=2cm, top = 1.7cm, bottom=1.7cm]{geometry}

\usepackage{graphicx}

\usepackage{caption}


\begin{document}

\begin{figure}[htp]
  \centering%
  \includegraphics[width=.33\linewidth]{example-image-a}%
  \includegraphics[width=.33\linewidth]{example-image-b}%
  \includegraphics[width=.33\linewidth]{example-image-c}%
  \caption[Fit for different redshift ranges]{The 
    best fits for each redshift range, $ (U-K)/(W2-NUV) 
    $ for $ z<1 $ (left), $ (I-W2)/(W3-U) $ for $ 1<z<3 $ (middle) and 
    $ (I-SPIT8)/(W4-R) $ for $ z>3 $ (right).}
  \label{fig:3graphs}
\end{figure}

\end{document}

As you can see I added % after your images and used .33 instead your .32 because the added % deletes the space between the images ... as you can see in the result:

resulting pdf

I suggest not to expand the graphics into margins and in your case it seems not to be needed ...

0

If you trim as much whitespace as you dare from each image (keeping all a similar width), then it is easy to push them into the margins without affecting other settings.

enter image description here

\documentclass[a4paper, 12pt]{article}

\usepackage{ifpdf}
\usepackage[latin1]{inputenc}
\usepackage[margin=2cm, left=2cm, top = 1.7cm, bottom=1.7cm]{geometry}
\usepackage{amsmath, mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{epigraph}
\usepackage{wasysym}
\usepackage[none]{hyphenat}
\usepackage[super]{nth}
%\usepackage{subfig}
\usepackage{textcomp}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{hyperref}
\usepackage[authoryear, super]{natbib}
\usepackage{comment}
\usepackage{setspace}
\usepackage{float}
\usepackage{dcolumn}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage{gensymb}

\begin{document}
\begin{figure}[htp]

    \centering

    \parbox{1.1\textwidth}{\hspace{-1.0cm}\includegraphics[width=.33\linewidth]{example-image-a}
    \includegraphics[width=.33\linewidth]{example-image-b}
    \includegraphics[width=.33\linewidth]{example-image-c}}

    \caption[Fit for different redshift ranges]{The best fits for each redshift range, $ (U-K)/(W2-NUV) $ for $ z<1 $ (left), $ (I-W2)/(W3-U) $ for $ 1<z<3 $ (middle) and $ (I-SPIT8)/(W4-R) $ for $ z>3 $ (right).}
    \label{fig:3graphs}

\end{figure}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .