Skip to content

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

Open
@Rmano

Description

@Rmano

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).

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