# How clip x-axis and horizontal grid lines in pgfplots? [closed]

In the following pgfplots plot, how do I clip the horizontal (x-) axis and the two horizontal grid lines so that the stop on the left a bit to the left of the vertical (y-) axix, say at x = -1.1, and stop on the right a bit to the right of x = 1, say at x = 1.1?

\documentclass[border=2mm]{standalone}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[thick,scale=1.0]
\begin{axis}[%
xmin=-0.01, xmax=1.1, ymin=-1.1, ymax=1.2,
xtick={1}, ytick={-1,1},
axis lines=middle,
xlabel={$x$}, ylabel={$y$}, axis equal,
ymajorgrids,
grid style={line width=0.5pt, draw=gray!70, dashed},
]

• Hm, try to remove option axis equal, and then see, if the result is what you after. Sep 19 at 23:46