\begin{Schunk}
\begin{Sinput}
 mycols <- ifelse((x-mx)*(y-my) > 0, "blue","red")
 plot(x,y, main="", col=mycols)
 abline(h=my, lty=4, col="black")
 abline(v=mx, lty=4, col="black")
 mtext(bquote(bar(x) ==.(mx)), side=1, line=2, at=mx)
 mtext(bquote(bar(y) ==.(my)), side=2, line=2, at=my)
\end{Sinput}
\end{Schunk}
