# Different xtick distance for different x ranges

I created a graph using tikz, which ranges from -10 to 10 for the xaxis.

The graph has an xtick distance of 2, but I want to change the xtick distance so I get this: -10,-5,0,2...10. From -10 to 0, I want steps of 5, and from 0 to 10, I want steps of 2.

Is this possible to do?

I have added my code as well.

\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\begin{axis}[xmin=-10, xmax = 10,ymin=0,
xtick distance=2,
xlabel=$x$,ylabel=$Error$,
title = {Output Error},
]
\end{axis}
\end{tikzpicture}
\end{figure}


Welcome to TeX-SE! You can just punch in what you want to get: xtick={-10,-5,0,2,4,...,10}. Obviously I do not have your data file.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=-10, xmax = 10,ymin=0,
xtick={-10,-5,0,2,4,...,10},
xlabel=$x$,ylabel=Error,
title = {Output Error},
]