circuitikz – How to Flip a Tnigfetd MOSFET in Circuitikz Diagram

circuitikz

I can't seem to flip a transistor in Circuitikz:

\documentclass{standalone}
\usepackage{circuitikz}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\draw (0,0) to [Tnigfetd] (0,2) node[]{NORMAL};
\draw (2,0) to [Tnigfetd, xscale=-1] (2,2) node[]{FLIPPED};

\end{tikzpicture}
\end{document}

Instead of flipping the shape about the horizontal axis, it flips where it puts the transistor:

enter image description here

How can I fix this?

(Other posts to this site have used xscale=-1 successfully with transistors, e.g. Flipping or rotating nodes in Tikz but not the labels)

Best Answer

The Tnigfetd is a path-type component, not a node-type one. So you use mirror (perpendicular to the path direction) and invert (parallel, although for historical reasons the logic is a bit strange):

\documentclass{standalone}
\usepackage{circuitikz}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\draw (0,0) to [Tnigfetd] (0,2) node[]{NORMAL};
\draw (2,0) to [Tnigfetd, mirror] (2,2) node[]{FLIPPED};
\draw (4,0) to [Tnigfetd, invert] (4,2) node[]{invert};
\draw (6,0) to [Tnigfetd, mirror, invert] (6,2) node[]{both};

\end{tikzpicture}
\end{document}

enter image description here

Never use xscale and yscale with path-type components, they mess with the coordinates (as you saw).

The relevant part of the documentation is here:

enter image description here