# axis x line* = top with axis line on the bottom

My question is almost the same as this, but in the linked question the user (an the answer) manually drawn the bottom line of the axis. The problem with that is that the tick marks aren't drawn as well. I adapted the MWE from the question:

\documentclass[border=1mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$,
axis x line*=top,
xmode=log, ymode=log]
\addplot[blue,mark=none,
domain=1:10,samples=40]
{exp(x)};
\end{axis}
\end{tikzpicture}
\end{document}


And the result is:

If I add a line in the bottom with:

...
\draw (axis description cs:0,0) -- (axis description cs:1,0);
\end{axis}
...


I get this:

But I want this (note the small tick lines at the bottom):

## 1 Answer

It seems to me that you only want to move the xtick labels. This can be achieved with xtick pos=both,xticklabel pos=upper.

\documentclass[border=1mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$,xtick pos=both,xticklabel pos=upper,
xmode=log, ymode=log]
\addplot[blue,mark=none,
domain=1:10,samples=40]
{exp(x)};
\end{axis}
\end{tikzpicture}
\end{document}


• Lovely! Thanks a lot! (The side doesn't let me click the check mark just now. I'll as soon as I can) – LaTeXer Nov 3 '19 at 15:51
• @LaTeXer In principle xticklabel pos=upper is sufficient but xtick pos=both does not hurt. ;-) – user194703 Nov 3 '19 at 16:16