\begin{tikzpicture}[x=.55cm,y=.55cm,font=\footnotesize,>=Latex] \foreach \shift/\title in {0/{(a) All seven labels},7/{(b) Four surviving labels}}{ \begin{scope}[xshift=\shift cm] \node at (3.2,6.2) {\title}; \draw[->] (-.4,0)--(7,0) node[right] {\(x\)}; \draw[->] (0,-.3)--(0,4.85) node[above] {\(x^2\bmod7\)}; \foreach \x in {0,...,6}{\draw (\x,-.08)--(\x,.08);\node[below] at (\x,-.1) {\x};} \foreach \y in {1,...,4}\node[left] at (-.1,\y) {\y}; \end{scope} } \foreach \a/\b/\y in {1/6/1,2/5/4,3/4/2} \draw[orange!80!black,dashed,thick] (\a,\y)--(\b,\y); \foreach \x/\y in {0/0,1/1,2/4,3/2,4/2,5/4,6/1} \fill[blue!75!black] (\x,\y) circle(2.5pt); \begin{scope}[xshift=7cm] \foreach \x/\y in {0/0,1/1,2/4,3/2}\fill[blue!75!black] (\x,\y) circle(2.5pt); \foreach \x/\y in {4/2,5/4,6/1}{ \draw[black!65] (\x-.12,\y-.12)--(\x+.12,\y+.12); \draw[black!65] (\x-.12,\y+.12)--(\x+.12,\y-.12); } \end{scope} \end{tikzpicture}