There are two results famously associated with Cantor's celebrated diagonal argument. The first is the proof that the reals are uncountable.
This clearly illustrates the namesake of the diagonal argument in this case. However, I am told that the proof of Cantor's theorem also involves a diagonal argument. Given a set $S$, suppose there exists a bijection $f:S\longrightarrow\ P(S)$ from $S$ to its powerset. The construction of the set $$B=\{b\in S\mid b\notin f(b)\}$$ is said to be a diagonal argument due to the dual occurrence of $b$ in $b\notin f(b)$. Now I am not exactly sure why this is called a diagonal argument. Is there a geometric representation of this argument like the picture above? Or is it simply an analogy to the first proof using the idea of constructing a witness to show $f$ is not surjective?