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? 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}

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.

pics for the subgraphs? – cfr Aug 12 '16 at 22:29shiftbut not for mirroring. – cfr Aug 12 '16 at 22:53picidea, I've learned again something new. But robustness with respect to mirroring is the more essential requirement. – gernot Aug 13 '16 at 08:50(#1,#2)I will replace the relevant positions(,)in the subgraph by(#1+,#2+); the subgraphs are macros anyway. Not as elegant as a general shift, but it works.