As you can see in the picture above, there is a lot of spacing between the start of a new page and the figure. However, this only seems to happen when the figure lands at a new page (I have set my topMargin to 0cm,so that can't be the problem). I have created this figure with Inkscape and the height of the total figure is almost the height of the sphere, so that can't be the reason. Here the contents of my document:
\documentclass[11pt]{extarticle}
\usepackage[left=3cm,right=3cm,top=0cm,bottom=2cm]{geometry}
\setlength{\parskip}{1em}
\usepackage{import}
\usepackage{graphics}
\usepackage{xifthen}
\usepackage{pdfpages}
\usepackage{transparent}
\usepackage{amsmath}
\setlength{\parindent}{0mm}
\newcommand{\incfig}[1]{
\def\svgwidth{\columnwidth}
\import{./figures/}{#1.pdf_tex}
}
\begin{document}
\section{Sphere}
\begin{figure}
\def\svgwidth{\columnwidth}
\fbox{\incfig{next}}
\caption{Sphere}
% \vspace*{-20pt} I have tried this but it doesn't seem to work
% it only gets the sphere on the page before if there is some space left
\end{figure}
\end{document}

centerenvironment, which adds some vertical spacing, in afigureenvironment, which also adds some vertical spacing. See what you obtain if you replace thecenterenvironment with the\centeringdirective. – Bernard May 25 '21 at 12:14\fbox{...}around the image would reveal the actual size (as seen from LaTeX) of the image. And that size can be a lot of white space. – daleif May 25 '21 at 12:19\sectioncalls\@afterheadingwhich affects the next paragraph. Try adding\null\paror\hrule height0ptafter \section to create an invisible next paragraph, – John Kormylo May 25 '21 at 14:08\fbox{\incfig{next}}by\rule{3cm}{4cm}using a rule of a size that shows the problem. Then we can run the test exampe and debug – David Carlisle May 25 '21 at 14:27