# How do i get the x axis on top but keep a line on the bottom

I have the following plot

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$,
axis x line*=box]
domain=-10:0,samples=40]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{document}


But i want the x axis on top:

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$,
axis x line*=top]
domain=-10:0,samples=40
]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{document}


How do i get the line in the bottom back?

The line is there, but it might get confused with the border of the standalone image; you can give some value to border if you want to distinguish it clearly:

\documentclass[border = 1pt]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$,
axis x line*=top]
\draw (axis description cs:0,0) -- (axis description cs:1,0);

The option border=1pt adds a little border (1pt wide) on the four sides; to add the border only on the bottom and left sides, use border={0pt 1pt 1pt 0pt} instead.