Skip to content

Part of grid is sometimes missing #497

@tgkolda

Description

@tgkolda

I have noticed that the upper/right parts of the grid are sometimes missing in pgfplots. I include an example. This fails with my local installation uisng MikTeX as well as on Overleaf. Observe that the lower & lefts parts of the grid are fine. This does not always happen. For instance, using xtick distance=2, minor x tick num=1, the left grid is fine. This is certainly a minor problem, but perhaps worthwhile to fix in some future edition.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
        scale only axis, height=10cm, width=8cm,
        axis lines=middle,
        grid=both,
        xmin=-8, xmax=8,
        xtick distance=4, minor x tick num=3,
        ymin=-12, ymax=12, 
        ytick distance=4, minor y tick num=3,
        enlargelimits={abs=1.9},
        ]
    \end{axis}
\end{tikzpicture}

\end{document}

The result is:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions