Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scatter/@pre marker code uses wrong transformation #483

Open
schtandard opened this issue Jul 7, 2024 · 1 comment
Open

scatter/@pre marker code uses wrong transformation #483

schtandard opened this issue Jul 7, 2024 · 1 comment

Comments

@schtandard
Copy link

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.

@schtandard
Copy link
Author

After playing around a bit more, it seems like error bars also feed into (xmin, ymin), so it's probably just the minimum of the data ranges (i.e. the lower left corner of the data area).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant