# x tick labels disappear

The x tick labels in my figure disappear when I change one option in my LaTeX code.

This is my original code:

\documentclass{article}

\usepackage{fp}
\usepackage{pgfplots}

\pgfplotsset{width=15cm, compat=1.12}

\newcommand{\tG}{20}
\newcommand{\xI}{150}
\newcommand{\vL}{16.67}
\newcommand{\aA}{1.2}
\newcommand{\aB}{1.5}

\FPeval\vResult{\aB * \vL / (\aA + \aB)}
\newcommand{\vS}{\vResult}

\FPeval\xResult{\xI - (\vS)^2 / (2*\aB)}
\newcommand{\xS}{\xResult}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
xlabel=$x_G$,ylabel=$v_G$,
domain=0:\xI,
y domain=0:20,
enlargelimits=false,
view={0}{90}]

{\tG - x/\vL + (\vL-y)^2/(2*\aA*\vL)};

{\tG - x/\vL + (\vL-y)^2/(2*\aA*\vL)};

quiver={
u={-1/\vL},
v={-(\vL-y)/(\aA*\vL)},
scale arrows=2,
},
-stealth,samples=15]
{\tG - x/\vL + (\vL-y)^2/(2*\aA*\vL)};

{\vL};

{sqrt( (\xI - x)*(2*\aB) )};

\addplot[mark=x, mark size=5] coordinates {(\xS,\vS)} node[label={[label distance=0cm]45:{$(x^*,v^*)$}}]{} ;

\end{axis}
\end{tikzpicture}

\end{document}


and my original output

When I change the code by adding one line, so that it becomes

\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
...


this is the result

As you can see, the x axis tick labels have disappeared and I don't know why. I think it may have something to do with the fact I am using 3D plots. Any ideas how I can get my labels back (and ensure the x axis is positioned at y=0)?

• Welcome to TeX.SE. What happend if you re-run pfdlatex again? Also, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Apr 20 '17 at 5:20
• In particular, your code has a lot of custom macros. At the very least add the definition of those, so that we don't have to figure out which numbers are appropriate. – Torbjørn T. Apr 21 '17 at 12:11
• @JohnKormylo axis x line=middle means that the x-axis is placed where y=0, not in the literal middle. As the surface plot stops at y=0, the ticklabels should be visible below it. – Torbjørn T. Apr 23 '17 at 15:27
• snibbets, do you really want to do that though? The quiver arrows will then partly cover the ticklabels, as they would with ymin=0,clip=false. – Torbjørn T. Apr 23 '17 at 15:41
• Thanks for your comments. I will add my solution below, although I'm not sure why it works. @PeterGrill I have edited the post and now list the entire file. – snibbets Apr 24 '17 at 1:07

I solved the problem by changing

axis x line=middle,


to

axis lines=middle,


which is equivalent to

axis x line=middle,
axis y line=middle,


Now I can see the tick labels on the x axis. Dunno why this works.