1

I have a figure with is made of 8 subfigures: 4 subfigures on the top and 4 subfigures on the bottom. The problem is that the end of the x axis is not always visible as some subfigures overlap with others and stop the end of the x axis from being printed as shown in the following screenshot. How to fix that?

enter image description here

\documentclass[xcolor=table,sigconf,review,anonymous]{acmart}
\usepackage{booktabs, makecell, multirow, tabularx}
\usepackage{siunitx}

%%
%% \BibTeX command to typeset BibTeX logo in the docs
% \AtBeginDocument{%
%   \providecommand\BibTeX{{%
%     \normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}

%\acmYear{2020}\copyrightyear{2020}
%\setcopyright{acmlicensed}
%\acmConference[ICSSP '20]{International Conference on Software and Systems Process}{May 23--24, 2020}{Seoul, Republic of Korea}
%\acmBooktitle{International Conference on Software and Systems Process (ICSSP '20), May 23--24, 2020, Seoul, Republic of Korea}
%\acmPrice{15.00}
%\acmDOI{10.1145/3379177.3388900}
%\acmISBN{978-1-4503-7512-2/20/05}


%\usepackage[utf8]{inputenc}

% \IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
%\usepackage{cite}

%\usepackage[textsize=tiny]{todonotes}
% \newcommand{\cmd}[1]{{\color{blue}CMD:  {#1}}}%
 %\newcommand{\mh}[1]{{\color{red}MH: {#1}}}%
 %\newcommand{\ae}[1]{{\color{orange}AE: {#1}}}%

\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{subcaption}
\usepackage[table,xcdraw]{xcolor}
\usepackage{multirow, tabularx, ragged2e}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{verbatim}
\usepackage{unicode-math}
\begin{document}

\title{test}
\maketitle

\begin{figure*}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Precision \% versus T$\rightarrow$N errors Seeding}
\label{TracePrecisionTError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Precision \% versus T$\rightarrow$N errors Seeding}
\label{NoTracePrecisionTError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Recall \% versus T$\rightarrow$N errors Seeding}
\label{TraceRecallTError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Recall \% versus T$\rightarrow$N errors Seeding}
\label{NoTraceRecallTError}
\end{subfigure}\hfill

\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Precision \% versus N$\rightarrow$T errors Seeding}
\label{TracePrecisionNError}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Precision \% versus N$\rightarrow$T errors Seeding}
\label{NoTracePrecisionNError}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Recall \% versus N$\rightarrow$T errors Seeding}
\label{TraceRecallNError}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Recall \% versus N$\rightarrow$T errors Seeding}
\label{NoTraceRecallNError}
\end{subfigure}
\caption{T trace/N trace Precision/Recall when seeding T$\rightarrow$N/N$\rightarrow$T errors}
\label{PrecisionRecall}
\end{figure*}

\end{document}

here is the example image

enter image description here

6
  • please include the code inline in the question (you can use example-image as the image. The question is archived here forever and will not make sense if you change the code at that link (and many people will not follow external links anyway) May 4, 2020 at 14:18
  • 1
    also note that overleaf is showing 4 errors after any error don't even look at the generated pdf it is at best usable for debugging, Please post an error free document that demonstrates the problem. May 4, 2020 at 14:20
  • I just did can you help me? May 4, 2020 at 14:26
  • 2
    I meant use example-image but OK, thanks, Note never do [width=5cm,height=4cm] as that will distort the image, only specify height or width, also just specify a width that will fit so [width=\linewidth] so it fits into your subfigure May 4, 2020 at 14:37
  • ! LaTeX Error: Command `\Bbbk' already defined. and ! LaTeX Error: Option clash for package xcolor. May 4, 2020 at 15:40

1 Answer 1

2

Once I had deleted all the spurious package calls so that the example runs without error:

\RequirePackage[demo]{graphicx}
\documentclass[xcolor=table,sigconf,review,anonymous]{acmart}



\usepackage{subcaption}


\begin{document}

\title{test}
\maketitle

\begin{figure*}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Precision \% versus T$\rightarrow$N errors Seeding}
\label{TracePrecisionTError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Precision \% versus T$\rightarrow$N errors Seeding}
\label{NoTracePrecisionTError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Recall \% versus T$\rightarrow$N errors Seeding}
\label{TraceRecallTError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Recall \% versus T$\rightarrow$N errors Seeding}
\label{NoTraceRecallTError}
\end{subfigure}\hfill

\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Precision \% versus N$\rightarrow$T errors Seeding}
\label{TracePrecisionNError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Precision \% versus N$\rightarrow$T errors Seeding}
\label{NoTracePrecisionNError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{T trace Recall \% versus N$\rightarrow$T errors Seeding}
\label{TraceRecallNError}
\end{subfigure}\hfill
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=5cm,height=4cm]{TracePrecisionVsTtoNError.png}
\caption{N trace Recall \% versus N$\rightarrow$T errors Seeding}
\label{NoTraceRecallNError}
\end{subfigure}
\caption{T trace/N trace Precision/Recall when seeding T$\rightarrow$N/N$\rightarrow$T errors}
\label{PrecisionRecall}
\end{figure*}

\end{document}

then you get

Overfull \hbox (20.7502pt too wide) in paragraph at lines 64--65

multiple times as a 5cm wide image does not fit in the space you have specified. That accounts for the over-printing.

In addition you should not specify height and width or it will distort the image, just specify one or the other. Here width=\linewidth will make it fit the sub-figures.

Changing all instances of [width=5cm,height=4cm] to [width=\linewidth] lets it run with no overfull box warnings.

3
  • Same comment as in the question above: You should add \hfill commands also on the lower 4 subfigures, so that the images are equally distributed on the upper and the lower part.
    – Nico
    May 4, 2020 at 15:48
  • @Nico I only looked at the log not the output or input:-) will fix, thanks:-) May 4, 2020 at 15:50
  • You are welcome :)
    – Nico
    May 4, 2020 at 15:52

You must log in to answer this question.

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