I'm still struggling to position labels with respect to their anchors in a way such that the anchors are correctly transformed by negative scaling (mirroring). In thread [tikz: label positioning that is robust with respect to negative scaling?](https://tex.stackexchange.com/questions/323401/tikz-label-positioning-that-is-robust-with-respect-to-negative-scaling) the problem seemed to be solved. The new anchors work with (negative) scaling and rotation, but break under shifts. Any idea how to modify the code for `anchor at angle` to respect shifting?

In the test images below, the bounding boxes of the labels as well as the anchor is shown. The first image is the original, untransformed version. The second image shows that mirroring at the y-axis works as expected: all anchors are mirrored correctly. The third and fourth image show that this is no longer true when shifting the image. The anchor seems to be where the line from the center following the shift vector meets the bounding box. Correctly, the third and fourth image should be identical to the first one.

```
\documentclass[tikz]{standalone}
\makeatletter
\tikzset
 {anchor at angle/.code=
   {\pgfpointtransformed{\pgfpointpolar{#1}{1pt}}
    \pgfmathanglebetweenpoints{\pgfqpoint{-\pgf@x}{-\pgf@y}}{\pgfpointorigin}
    \def\tikz@anchor{\pgfmathresult}
   }
 }
\newcommand\test[1]%
 {\tikz[#1] \draw (0,0) node{#1}
  \foreach \A/\L in {0/a,30/b,60/c,90/d,120/e,150/f,180/g,210/h,240/i,270/j,300/k,330/l}
  { (\A:1.5cm) node[circle,draw,inner sep=0,minimum width=5mm] {} % circle
   +(\A:  4mm) node[anchor at angle=\A+180,inner sep=0,draw] {\L} % label
               node[circle,inner sep=0,fill=black,minimum width=0.5mm] {} % anchor marker
  };
 }
\begin{document}
\test{}
\test{xscale=-1}
\test{shift={(1,1)}}
\test{shift={(1,0)}}
\end{document}

```

![](https://i.stack.imgur.com/zHuB6.jpg)
![](https://i.stack.imgur.com/kYo0J.jpg)
![](https://i.stack.imgur.com/VfmLM.jpg)
![](https://i.stack.imgur.com/KMAbY.jpg)

What I need it for: I construct graphs that I want to be able to flip upside down or left-right by need. The problem is to attach labels to the nodes whose positions (anchors) will also flip. Standard tikz labels are unaffected by negative scaling and will end up in the wrong position after flipping. As it happens, these graphs have some repetitive structures that I construct by shifting sub-graphs to the right position. This is the point were label positioning currently fails.
[![enter image description here](https://i.stack.imgur.com/xXGI6.jpg)](https://i.stack.imgur.com/xXGI6.jpg)