# How to get rid of notch at pgfplots axes intersection?

The 2nd page of the .pdf file generated by the following .tex file:

\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\framezoom<1><2>(0cm,5.5cm)(0.5cm,0.5cm)
\begin{tikzpicture}
\begin{axis}[%
axis x line=bottom,
axis y line=left,
ymin=0,
xtick=\empty,
ytick=\empty,
]
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}


points out a notch at axes intersection:

How could I get rid of this notch?

Note that this question is similar to:

I think the simplest solution is to add line cap=rect to the axis line style. To apply it to all non-boxed axis add it to the corresponding style, here shown for the x axis only. I also added opacity for demonstration purposes, which of course you should comment or delete for the end use case.

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{
every non boxed x axis/.append style={
axis line style={
line cap=rect,
% this is for demonstration purposes only
% comment me for real use case
opacity=0.5,
},
},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis y line=left,
ymin=0,
xtick=\empty,
ytick=\empty,
]
\end{axis}
\end{tikzpicture}
\end{document}


Two possible workarounds. First one is to increase the length of the axis lines by half the line width, the second to draw the axis lines manually as a single line.

\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\framezoom<1><2>(0cm,5.5cm)(0.5cm,0.5cm)
\begin{tikzpicture}
\begin{axis}[%
axis x line=bottom,
axis y line=left,
ymin=0,
xtick=\empty,
ytick=\empty,
axis line style={shorten <=-0.5\pgflinewidth}, % added
]
\end{axis}
\end{tikzpicture}
\end{frame}
\begin{frame}
\framezoom<1><2>(0cm,5.5cm)(0.5cm,0.5cm)
\begin{tikzpicture}
\begin{axis}[%
axis x line=bottom,
axis y line=left,
ymin=0,
xtick=\empty,
ytick=\empty,
execute at begin axis={\draw [latex-latex] (current axis.north west) |- (current axis.south east);} % added
]
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}

• Workaround, but nice... but workaround: IMHO, should be fixed in pgfplots. I will let Christian know. – Denis Bitouzé Aug 30 '16 at 16:08
• @DenisBitouzé That's not a fixable problem as is. If he fixes this then others will break. Read separate axis lines explanation in the manual – percusse Aug 30 '16 at 16:23
• @percusse Ah, indeed. But as separate axis lines=false doesn't help in my case, maybe a new, meaningful, option could be added to get properly closed edges at axes intersection. – Denis Bitouzé Aug 30 '16 at 16:50

it looks like that the axis environment doesn't take the optional argument into account. Draw the axis lines outside of the environment:

 \draw[<->,line join=round,line width=10pt](0,6) -- (0,0) -- (8,0);


For possible values see p. 167 of the documentation.

I don't use TikZ, but this same issue exists in all drawing packages that use Postscript-style end caps on lines. In Postscript terminology, the effect you're seeing comes from using "flat" end caps on the lines. Better to use either "square" end caps or "round" ones. The three pictures below show (from left to right), flat, square and round end caps. The picture comes from Powerpoint, but you get the same kinds of results in many drawing programs.