Figure in Latex Is Not Centering Despite Using \Centering

I am very new to LaTex and am trying to center a figure.

I have tried to use the package float using both [h] and [H], I have tried to add \centering and I have tried to wrap the image in \begin{center} \end{centering} but nothing seems to work.

My full code is as such

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{float}
\graphicspath{ {images/} }

\title{Dissertation}
\author{GC}
\date{\today}


\begin{document}

\maketitle

\section{Introduction}
\begin{figure}[H]
    \centering
    \includegraphics{my_grades}
    \caption{grades plot}
    \label{fig:grade}
\end{figure}

This figure does not seem to want to centre

\end{document}

This figure on the compiled document looks as such. If someone could help me understand why this doesn't want to move that would be great:

4

1 Answer

Your code seems fine, I just added a [width=50mm] in your include graphics and it centered the Figure.

I would check two issues:

  1. Is your figure to larger than the textwidth?
  2. Does your Figure has a white part on its lefthand side?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{float}
\graphicspath{ {images/} }

\title{Dissertation}
\author{GC}
\date{\today}


\begin{document}

\maketitle

\section{Introduction}
\begin{figure}[H]
    \centering
    \includegraphics[width=50mm]{darth-vader_5yvm.jpeg}
    \caption{grades plot}
    \label{fig:grade}
\end{figure}

This figure does not seem to want to centre

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest