Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can one have an axes labels (x and z near the axis) like this:

enter image description here

share|improve this question
    
x and z labels. –  m0nhawk Feb 6 '13 at 11:57
add comment

1 Answer 1

up vote 5 down vote accepted

You can place the axis labels at the tip of the axis lines by setting

axis lines=middle,
xlabel=$x$, xlabel style={at=(current axis.right of origin), anchor=west},
ylabel=$y$, ylabel style={at=(current axis.above origin), anchor=south}

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis lines=middle,
    xlabel=$x$, xlabel style={at=(current axis.right of origin), anchor=west},
    ylabel=$y$, ylabel style={at=(current axis.above origin), anchor=south},
    xtick=\empty, ytick=\empty
]
\addplot [very thick, domain=0:10] {x+rnd};
\end{axis}
\end{tikzpicture}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.