so my problem right now is that I don't find a proper way of inserting my pictures correctly inside my text. I tried using \begin{figure*}, \begin{figure}, \begin{center} and I tried using subfigures and \maketable and nothing really works. Right now I am having this code:
\begin{figure}
\centering
\includegraphics[width=\textwidth, height=1.5]{OneK.png}
\caption{Screenshot with k = 1}
\end{figure}
\FloatBarrier
\begin{figure}
\includegraphics[width=\linewidth, height=0.5]{FourK.png}
\caption{k = 4}
\end{figure}
\FloatBarrier
\begin{figure}
\includegraphics[width=\textwidth, height=0.5]{FinalScreenshot.png}
\caption{k = 12 + curve}
\end{figure}
\FloatBarrier
However, the first figure is floating to the other section, even though I want all these images to be in the other subsection. Moreover, I want to change size, it doesn't, so I am having a two column text and want to fit these three figures as such they are readable, but do not take more than half a page. All three images are screenshots. So basically, I want the first two pictures to be side by side, and the last pictures to be below the first two but then with all the width of the two columns. Can you help me please?
My document looks as follows (I deleted the text):
\documentclass[11pt,a4paper]{article}
\usepackage[hyperref]{acl2020}
\usepackage{times}
\usepackage{latexsym}
\usepackage{subcaption}
\usepackage[export]{adjustbox}
\usepackage{graphicx}
\usepackage{placeins}
\renewcommand{\UrlFont}{\ttfamily\small}
\usepackage{microtype}
% Determine if the image is too wide for the page.
\makeatletter
\def\ScaleIfNeeded{%
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\makeatother
% Resize figures that are too wide for the page.
\let\oldincludegraphics\includegraphics
\renewcommand\includegraphics[2][]{%
\oldincludegraphics[width=\ScaleIfNeeded]{#2}
}
\aclfinalcopy % Uncomment this line for the final submission
%\def\aclpaperid{***} % Enter the acl Paper ID here
\newcommand\BibTeX{B\textsc{ib}\TeX}
\title{Coursework 1}
\begin{document}
%\maketitle
\thispagestyle{plain}%
\section{Task A: k-means clustering}
Text in here
\subsection{Task A: Screenshots of running program}
\begin{figure}
\centering
\includegraphics[width=\textwidth, height=1.5]{OneK.png}
\caption{Screenshot with k = 1}
\label{fig:Figure 1}
\end{figure}
\FloatBarrier
\begin{figure}
\centering
\includegraphics[width=\linewidth, height=0.5]{FourK.png}
\caption{k = 4}
\label{fig:Figure 2}
\end{figure}
\FloatBarrier
\begin{figure}
\centering
\includegraphics[width=\textwidth, height=0.5]{FinalScreenshot.png}
\caption{k = 12 + curve}
\label{fig:Figure 3}
\end{figure}
\FloatBarrier
\subsection{Task A: Figure and Analysis}
\begin{figure}[!htbp]
\begin{center}
\includegraphics[width=.4\textwidth]{elbow_curve.png}
\end{center}
\caption{Elbow curve}
\label{fig:Figure 4}
\end{figure}
\FloatBarrier
\section{Task B: Classification with k-nearest neighbor}
%References - needs no heading
\bibliography{bib}
\bibliographystyle{apa}
\end{document}
\documentclass
and ending with\end{document}
, such that we see the general document setup, like document class, settings, packages? – gernot Nov 8 '19 at 19:17width=\textwidth, height=1.5
don't supply both height and width or you will distort the image, use one or the other. Also the default units are bp (PostScript Points) soheight=1.5
will be barely visible around a 1/3 the height of anx
– David Carlisle Nov 8 '19 at 19:21