6

I have this plot generated following the answers proposed here.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}

\pgfkeys{/pgfplots/x axis shift down/.style={
    x axis line style={yshift=-#1},
    xtick style={yshift=-#1},
    xticklabel shift={#1}}}
\pgfkeys{/pgfplots/y axis shift left/.style={
    y axis line style={xshift=-#1},
    ytick style={xshift=-#1},
    yticklabel shift={#1}}}
\pgfplotsset{every axis/.append style={semithick,tick style={major tick
length=4pt,semithick,black}}}    

\pgfplotsset{
    range frame/.style={
        tick align=outside,
        axis lines*=left,  
        separate axis lines,
        x axis shift down=10pt,
        y axis shift left=10pt,
        enlarge x limits=false,
        enlarge y limits=false,
        }
}

\begin{tikzpicture}
\begin{axis}[
    range frame,
    title={Axial ratio},
    xlabel={frequency, GHz},
    ylabel={dB},
    yticklabel style={/pgf/number format/precision=3},
    xtick=data,
    ytick=data,
]
    \addplot[black,mark=*,smooth] coordinates {(37.0,0.67534604814572) (37.1,0.66594092733667)
(37.2,0.66026355025028)
(37.3,0.65812677526894)
(37.4,0.65927865540192)
(37.5,0.66342752821752)};
\end{axis}
\end{tikzpicture}
\end{document}

Everything works fine, except for this little glitch:

enter image description here

What's the reason behind it?

  • Could it be that this is just an aliasing effect between the graphic and you computer display's resolution? Does it persist at different zoom levels? Does it also show up if the plot is printed? – Benedikt Bauer Sep 15 '14 at 11:15
  • 1
    Just tried it out myself, and it is persistent through zoom levels and seems related to the x axis shift down directive. – Benedikt Bauer Sep 15 '14 at 11:21
  • 4
    That happens because using Andrew's approach, the axis lines are shifted but the clip boundary isn't enlarged. You can fix the problem in this case by setting clip=false. Note that this won't work if you actually need the clipping feature, though. – Jake Sep 15 '14 at 11:24
  • Thank you all! Actually a duplicate, clip=false solves the problem. – Alessandro Cuttin Sep 15 '14 at 12:02

0 Answers0