The following code plots data from two files. How can I modify the code such that the color of addplot is chosen depending on which quadrant the first x-y pair in the data file belongs to? For example, assume that I want plots originating in the second and third quadrants to be green and magenta, respectively, then tmp1.dat and tmp2.dat should be plotted in green and magenta, respectively.
\documentclass[]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{filecontents}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{filecontents}{tmp1.dat}
x y
-1 1
0 0
1 1
\end{filecontents}
\begin{filecontents}{tmp2.dat}
x y
-1 -1
0 0
1 -1
\end{filecontents}
\begin{tikzpicture}
\begin{axis}
\foreach \i in {1,2}
{
\addplot table {tmp\i.dat};
};
\end{axis}
\end{tikzpicture}

