Skip to content

scatter/@pre marker code uses wrong transformation #483

Open
@schtandard

Description

@schtandard

According to the documentation, the coordinate system inside scatter/@pre marker code is transformed such that (0,0) is the plot coordinate. However, this does not seem to be the case.

\documentclass{article}

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

\begin{document}

\begin{tikzpicture}
  \begin{axis} [
        scatter,
        scatter/@pre marker code/.append code={
          \draw (0,0) circle [radius=.2cm];
        },
      ]
    \addplot+ {x^2 - 5};
  \end{axis}
\end{tikzpicture}

\end{document}

image

There's an additional offset. From playing around with the function a bit it seems like, modulo some rounding/imprecision, the offset is (xmin, ymin), where xmin (ymin) is the minimum of the data's x (y) coordinates.

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