I have prepared a MWE, where I have tried different approaches, how a tikz pic can be scaled AND positioned absolute:
\documentclass{standalone}
\usepackage{lmodern}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
\pgfplotsset{compat=1.11}
\usetikzlibrary{positioning,backgrounds,symbols,shapes,shapes.arrows,arrows,shadows,fit,calc,matrix,decorations.text,arrows.meta,shadows.blur,shapes.symbols,automata,fpu,intersections,fadings,shadings}
\tikzset{
Test/.pic = {
\draw (0, 0) arc[start angle=180, end angle=0, x radius=5cm, y radius=2.5cm]
-- ++ (0, 2cm) arc[start angle=0, end angle=180, x radius=5cm, y radius=2.5cm]
-- cycle;
\path[draw=none, postaction={decorate},decoration={text along path,
text={|\fontsize{16mm}{19mm}\bfseries\color{red}|text},
text align=center}] (0, 0.5cm) arc [start angle=180,end angle=0,x radius=5cm, y radius=2.5cm];
\node at (5cm, 1cm) {\fontsize{16mm}{19mm}TEXT};
}
}
\begin{document}
\begin{tikzpicture}[every node/.append style={transform shape}]
\draw (-1cm, -1cm) rectangle (11cm, 9cm);
\pic[] at (0, 3cm) {Test};
\pic[scale=0.25] at (8cm, 0) {Test}; %Scales all but the text along the path
\begin{pgflowlevelscope}{\pgftransformscale{0.25}}\pic at (4*4cm, 0) {Test};\end{pgflowlevelscope} %Scales and positions right, if I consider the scale factor as an additional multiplication by 4.
\begin{pgflowlevelscope}{\pgftransformscale{0.25}}\pic{Test};\end{pgflowlevelscope} %Scales but no way to set the position
\end{tikzpicture}
\end{document}
I want to scale my pics according to the \pic[scale=0.5]
property or something similar.
So I have different approaches:
`\pic[] at (0, 3cm) {Test};': This is the reference approach, where no scaling is needed. (It can be seen in the image below as the top variant)
\pic[scale=0.25] at (8cm, 0) {Test};
: As you can see at the image below (variant on the bottom right), the problem with the code is that the\pic[scale=0.5] ...
variant scales everything correct, but not the text which is defined astext along path
.\begin{pgflowlevelscope}{\pgftransformscale{0.25}}\pic at (4*4cm, 0) {Test};\end{pgflowlevelscope}
: This is the variant, which scales everything correct, but the positioning of the\pic
is much harder. Because here I have to keep in mind, that in the future the scaling by factor 1/4 is applied, and therefore the coordinates must be multiplied by 4, to position it correctly.
What I want to know, is if there is another approach of scaling which does meet my requirements. (they are scale by a certain factor and also direct absolute positioning without keeping in mind the scaling factor at the absolute position calcuation step).
\pic[scale=0.25, transform shape] at (8cm,0) {Test};
. If you want to scale shapes & positions but not text, here's a dumb solution:\path[scale=0.25] pic[scale=0.25] at (8cm, 0) {Test};
. – wklchris Apr 25 '18 at 23:17