1

I am relatively new to TeX and I am trying to create a subfigure graphic with 3 figures and one table. I managed to do that beside one problem: Below the table is a strange line (see picture) and I can not find a solution how I could delete it.

enter image description here

Here is my current code:

\begin{landscape}

\begin{figure}[H]

    \centering
    \subfigure{\includegraphics[width=0.49\linewidth]{./graphic1}}
    \subfigure{\includegraphics[width=0.49\linewidth]{./graphic2}}\\[-5ex]

    \begin{subfigure}{\begin{tabular}{|ccc|ccc|}\\[-47ex]

                \hline
                Wert & Modell & Ausfall & HD & PMM & PMM HD\\
                \hline

                KIRate & UM & MAR 2 & 9.6 & 93.4 & 95.3\\
                KIRate & UM & MAR 3 & 0.0 & 58.4 & 64.2\\
                \hline
                KIRate & RM & MAR 2 & 0.0 & 6.1 & 20.5\\
                KIRate & RM & MAR 3 & 0.0 & 0.0 & 0.0\\
                \hline
                KIBreite & UM & MAR 2 & 0.87 & 2.28 & 2.29\\
                KIBreite & UM & MAR 3 & 0.87 & 2.16 & 2.15\\
                \hline
                KIBreite & RM & MAR 2 & 0.87 & 1.20 & 1.20\\
                KIBreite & RM & MAR 3 & 0.86 & 1.03 & 1.09\\
                \hline

            \end{tabular}}
        \end{subfigure}\hspace{0.02\textwidth}
        \subfigure{\includegraphics[width=0.49\linewidth]{./graphic3}}\hspace{-0.11\textwidth}
        \vspace{-2em}
        \caption{Some text} 

    \end{figure} 

\end{landscape}

Here, I found a similar topic: longtable - strange lines at the end of table But unfortunately I can not figure out the problem in my specific case.

How could I delete that line? I guess there must be a very easy solution, which I can not find. Thank you very much in advance!

  • Please make your code compilable. Add preamble to it. – Zarko Mar 5 '17 at 16:07
  • 1
    The culprit is the double backslash starting the table, in \\[-47ex]. It starts a new table line with a vertical bar, then the remaining lines are shifted upwards. – gernot Mar 5 '17 at 16:19
  • Thank you @ gernot for the detection of the problem! Originally, I added the \\ to be able to insert the [-47ex] afterwards. Without the [-47ex] there appears a big gap between the table and the first graphic. – JSP Mar 6 '17 at 7:57
  • @ Zarko and Kurt, sorry for the missing code. Next time I will add a preamble! – JSP Mar 6 '17 at 7:58
3
\documentclass{report}
\usepackage[demo]{graphicx}
\usepackage{rotating}% had to be before graphicx package
\usepackage{caption,subcaption}

\usepackage{showframe}% only for this MWE, for show page layout

\begin{document}
\begin{sidewaysfigure}
    \centering
    \begin{subfigure}[b]{0.48\linewidth}
        \centering
    \includegraphics[width=\linewidth]{graphic1}
    \caption{A}
    \end{subfigure}
    \begin{subfigure}[b]{0.48\linewidth}
        \centering
    \includegraphics[width=\linewidth]{graphic2}
    \caption{B}
    \end{subfigure}

    \bigskip
    \begin{subtable}[b]{0.48\linewidth}
        \centering
        \begin{tabular}{|ccc|ccc|}
                \hline
                Wert & Modell & Ausfall & HD & PMM & PMM HD\\
                \hline
                KIRate & UM & MAR 2 & 9.6 & 93.4 & 95.3\\
                KIRate & UM & MAR 3 & 0.0 & 58.4 & 64.2\\
                \hline
                KIRate & RM & MAR 2 & 0.0 & 6.1 & 20.5\\
                KIRate & RM & MAR 3 & 0.0 & 0.0 & 0.0\\
                \hline
                KIBreite & UM & MAR 2 & 0.87 & 2.28 & 2.29\\
                KIBreite & UM & MAR 3 & 0.87 & 2.16 & 2.15\\
                \hline
                KIBreite & RM & MAR 2 & 0.87 & 1.20 & 1.20\\
                KIBreite & RM & MAR 3 & 0.86 & 1.03 & 1.09\\
                \hline
            \end{tabular}
    \caption{C}
        \end{subtable}%
        \begin{subfigure}[b]{0.48\linewidth}
            \centering
        \includegraphics[width=\linewidth]{graphic3}
    \caption{D}
        \end{subfigure}
        \caption{Some text}
\end{sidewaysfigure}
\end{document}

enter image description here

Your code snippet is no of big help it only indicate, that you have problems in preamble of your document, which you didn't show (see Mico Comment). So above MWE is based on guessing, what you like to obtain. Spurious line arise because of unusulay coding. In comparison to your code i made the following changes:

  • wrote consistent preamble, where I uasume, that for landscape fugure with table is better to use sidewaysfigure from rotating package
  • for subfigures is used subfigure environment determined by package subcaption (your use of subfigure is not consistent, the same time indicate that you probably use obsolete subfigure package)
  • deleted are all manually positioning of subfigures and sub tables

If you not need subcaptions, than simply delete \caption{...} in subfigures/subtable.

  • 1
    Thank you for the great answer, that worked pretty good! Next time I will add a preamble to my code. – JSP Mar 6 '17 at 7:53

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.