I'm designing a diagram for a 1-D potential well. I'm struggling to correctly place my a label below the right hand line. I resorted to drawing an invisible line and positioning the node at the end. Further to this, how do I add grey shading to the area outside of the red lines?
Cheers
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[-stealth] (-0.5,0) -- (pi,0) node[right]{\(x\)};
\draw[-stealth] (0,-0.5) -- (0,4) node[above]{\(V(x)\)};
\draw[thick, red, ->, >=stealth] (0,0) -- (0,3) node[left, blue]{\(\)};
\draw[thick, red,->, >=stealth] (2.5,0) -- (2.5,3);
% \node[draw] at (2.5,-0.2) node[right, black]{\(a\)};
\draw[line width=0pt] (0,0) -- (2.5,0) node[below, black]{\(a\)};
\end{tikzpicture}
\end{document}
