I want to produce a comparison graph chart like this:
I have found information about bar graphs, but not about line comparison graphs as I am trying to do. Any help?. Thanks.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communitySuch plots are called comb plots and they are described in detail in section 4.5.7 Comb Plots of the pgfplots manual (v 1.16). Since I do not have your data, I copied the example from there, and modified the coordinates of the second plot slightly, and also introduced a nontrivial dash pattern.
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot+ [line width=1pt,
ycomb,
] coordinates {
(0,3) (1,2) (2,4) (3,1) (4,2)
};
\addplot+ [line width=1pt,dash pattern=on 4pt off 1pt on 2pt off 1pt,
ycomb,
] coordinates {
(0,3.4) (1,1.8) (2,4.2) (3,1.2) (4,1.6)
};
\end{axis}
\end{tikzpicture}
\end{document}