I'm new to LaTeX and currently trying to write myself a report template that I can use for future work.
Anyway, here is a MWE showing the error:
\documentclass[12pt,twoside,a4paper]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{epsFig}
\caption{This is where a caption would go. Include the image in the folder of the project, the image must have a .eps file format.}
\label{fig:example}
\end{figure}
\end{document}
And the output ends up looking like this:

That is, there's not enough space on the previous page to place the image so it is moved on to the next page, but it ends up at the bottom left of the page covered by the caption.
The image was created using MatLAB, I use TexnicCentre with Miktex2.9. Can anyone help?
edit: The file extension for the image is .eps The image is at this link
\usepackage[demo]{graphicx}I (fortunately) don't get the figure misplaced as in your document. Hence, I think we need more context here. Are you really running only the given example as it stands? Is your MatLAB plot a pdf? Does it contain whitespace in the top and in the right? – Ruben Jul 20 '15 at 15:44standalonedocument withborder=0pt. This should correct the bounding box, after which you can include the updated image as part of your original document. – Werner Jul 20 '15 at 17:38