I want to make my "xticklabels" have a new line between them so that they are in two lines and not as cramped. The double backslash \\ and \n did not work.
Code:
\documentclass{standalone}
\usepackage{tikz,pgfplots,pgfplotstable}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{statistics}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=0.9\textwidth,
boxplot/draw direction=y,
axis y line=left,
enlarge y limits,
ylabel={Impact of latency},
xlabel={Game and latency},
ytick={1, 2, 3, 4, 5},
yticklabels={1, 2, 3, 4, 5},
ymajorgrids,
xtick={1, 2, 3, 4},
xticklabels={Chess 0ms , Chess 1000ms, Pong 0ms, Pong 1000ms},
]
\addplot+ [boxplot prepared={lower whisker=1, upper whisker=2}] coordinates {};
\addplot+ [boxplot prepared={lower whisker=2, upper whisker=4}] coordinates {};
\addplot+ [boxplot prepared={lower whisker=1, upper whisker=2}] coordinates {};
\addplot+ [boxplot prepared={lower whisker=4, upper whisker=5}] coordinates {};
\end{axis}
\end{tikzpicture}
\end{document}