# Node only partially rendered near edge of plot

I'm trying to draw a relatively simple chart of a number line, and when one of the nodes is too close to the edge of the plot, it gets cut off.

The code:

\documentclass{article}

\usepackage{natbib}
\usepackage{graphicx}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
width=\columnwidth,
axis y line=none,
axis lines=left,
axis line style={-},
xmin=0,
xmax=1,
ymin=0,
ymax=1,
xlabel=$\mu$,
scatter/classes={o={mark=*}},
restrict y to domain=0:1,
xtick={0,1}
]
\draw[ultra thin] (axis cs:0, 0) -- (axis cs:0,.05);
\draw[ultra thin] (axis cs:.4, 0) -- (axis cs:.4,.05);
\node[coordinate,label=above:{$B$}] at (axis cs:0.0,0.05) {};
\node[coordinate,label=above:{$A$}] at (axis cs:0.4,0.05) {};
\node[coordinate,label=above:{$b$}] at (axis cs:0.2,0.02) {};
\node[coordinate,label=above:{$a$}] at (axis cs:0.7,0.02) {};
\end{axis};
\end{tikzpicture}
\end{document}


The Result:

How do I get the B to fully render?

-

By default any paths inside the axis bounding box is clipped, this is what cuts the B. To turn off clipping, add clip=false to the axis options.

Clipping is discussed in section 4.19.2 Clipping of the manual (for version 1.8 of pgfplots, dated 2013-03-07).

As mentioned by Jake in a comment: In version 1.8 of pgfplots the key clip mode=individual was introduced, which will clip plot lines, but not normal nodes.

\documentclass{article}

\usepackage{natbib}
\usepackage{graphicx}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
width=\columnwidth,
axis y line=none,
axis lines=left,
axis line style={-},
xmin=0,
xmax=1,
ymin=0,
ymax=1,
xlabel=$\mu$,
scatter/classes={o={mark=*}},
restrict y to domain=0:1,
xtick={0,1},
clip=false    % <-- new addition
% clip mode=individual  % alternative
]
\draw[ultra thin] (axis cs:0, 0) -- (axis cs:0,.05);
\draw[ultra thin] (axis cs:.4, 0) -- (axis cs:.4,.05);
\node[coordinate,label=above:{$B$}] at (axis cs:0.0,0.05) {};
\node[coordinate,label=above:{$A$}] at (axis cs:0.4,0.05) {};
\node[coordinate,label=above:{$b$}] at (axis cs:0.2,0.02) {};
\node[coordinate,label=above:{$a$}] at (axis cs:0.7,0.02) {};
\end{axis};
\end{tikzpicture}
\end{document}

-