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

Using scale in the enclosing tikzpictures gives wrong coordinates outside "axis" #494

Open
Rmano opened this issue Nov 13, 2024 · 0 comments

Comments

@Rmano
Copy link

Rmano commented Nov 13, 2024

This could be related to #375, and probably the answer is "don't do that" (*), but:

\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}[
    scale=0.8 % transform shape doesn't change anything
    ]
        \begin{axis}[grid=both, no marks]
            \addplot {x};
            \path (0,1) coordinate(splat) node[circle,draw]{};
        \end{axis}
        \node[draw=red, thick] at (splat) {};
\end{tikzpicture}
\end{document}

image

If you comment out the scale, you have the correct:

image

I have a much more complex example, if you want, with a circuit and a couple of axis that show waveforms. I tried to scale the whole diagram to fit with scale=... ; transform shape and found this problem.


(*) You can avoid it, obviously, but sometimes it is not handy... Using an external \scalebox makes alignment of the whole picture with baseline=(some internal node) quite horrible, and the result is not the same (line thickness, for example).

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