I am calculating eigenvlaues. Some are negative, some are positive. I define the index nn and mm (as well as np and mp) of each matrix element by some functions that assign positive, zero and negative integer values for nn (np) and strictly positive integers for mm (mp). My code is much more complex, but a simplified version of it looks like this:
nn = 2; mm = 3; som = 2 (nn + 1) mm; RX = 1; PO = 5;
n[a_] := Floor[(a - 1)/mm] - Floor[(a - 1)/((nn + 1) mm)] - nn;
m[a_] := Mod[a - 1, mm] + 1;
np[b_] := Floor[(b - 1)/mm] - Floor[(b - 1)/((nn + 1) mm)] - nn;
mp[b_] := Mod[b - 1, mm] + 1;
Vnozer[nn1_, np1_, mm1_,
mp1_] := (2 nn1 + 3 np1 + 4 mm1 + 5 mp1) Exp[kx];
Vzer[nn1_, np1_, mm1_,
mp1_] := (-4 nn1 - 3 np1 - 2 mm1 - 1 mp1) Exp[kx];
V[nn1_, np1_, mm1_, mp1_] :=
If[Abs[nn1] > 0 && Abs[np1] > 0, Vnozer[nn1, np1, mm1, mp1],
Vzer[nn1, np1, mm1, mp1]];
EN[nn1_] := Sign[nn1] Sqrt[Abs[nn1]];
c[a_, b_] :=
EN[n[a]] KroneckerDelta[Abs[n[a]], Abs[np[b]]] KroneckerDelta[m[a],
mp[b]] KroneckerDelta[Sign[n[a]], Sign[n[b]]] +
V[n[a], np[b], m[a], mp[b]];
Q = Array[c, {som, som}];
MF = Table[{kx, Eigenvalues[Q]}, {kx, -RX, RX, (2 RX)/(PO - 1)}];
Array[ou, som]; Array[pl, som];
Table[ou[y] = Table[{MF[[x, 1]], MF[[x, 2]][[y]]}, {x, 1, PO}], {y, 1,
som}];
Table[pl[y] = ListPlot[ou[y], PlotRange -> All], {y, 1, som}];
FPL = Table[pl[z], {z, 1, som}];
Show[FPL]
I would like to get Red PlotMarkers when my eigenvalues are positive and, say, Blue when my eigenvalues are negative. I played around with an If statement, but I was not able to figure out the right syntax. Something along the lines
PlotMarkers->{If[x]>0, {Red, dotsize}, {Blue, dotsize}}
pts = RandomInteger[{-10, 10}, 100]; ListPlot@GatherBy[pts, Positive]
$\endgroup$