Let's create some sample data

```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], RandomReal[{-1, 1}]}, {i, 1, n}];

```

Now I want the following: create a list plot with the first element of the list as $x$ coordinate and the third element as the $y$ coordinate. 

```
d0 = Table[{d00[[i, 1]], d00[[i, 3]]}, {i, 1, Length[d00]}];

```

The color of each point is controlled by the corresponding second element. In particular, if the real number is between -2 and 2 the point should be green, while if it is lower/equal than -2 or greater/equal than 2 the point should be red.

Any suggestions?
['https://mathematica.stackexchange.com/questions/114445', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/5052/']
Here's another option:

```
l = RandomReal[{-4, 4}, {200, 3}];

 ListPlot[
 List /@ (l[[All, {1, 3}]])
 , PlotStyle -> (If[Abs[#[[2]]] < 2, Green, Red] & /@ l)
 ]

```

Where you can use any function that returns a color in your styling. You might want have to rescale your data if it's not in the range {0,1}.

[![enter image description here](https://i.stack.imgur.com/ojGxm.png)](https://i.stack.imgur.com/ojGxm.png)

If you want to change point sizes you can use `Directive`

```
ListPlot[
 List /@ (l[[All, {1, 3}]])
 , PlotStyle -> (If[Abs[#[[2]]] < 2, 
      Directive[Green, PointSize[0.04]], Red] & /@ l)
 ]

```

This gives:

[![enter image description here](https://i.stack.imgur.com/1JL5N.png)](https://i.stack.imgur.com/1JL5N.png)
Another way is to use `Graphics` which gives you more control over your plot.

```
n = 100;
d00 = Table[{RandomReal[{-1, 1}], RandomReal[{-4, 4}], 
   RandomReal[{-1, 1}]}, {i, 1, n}];

{x1, x2} = {Min[#], Max[#]} &@d00[[All, 2]];
col[x_] := If[Abs[x] < 2, Green, Red]  (*for color*)
scale[x_] := (x - x1)/(x2 - x1)/20     (*for point size*)
Graphics[{col[#[[2]]], Disk[#[[{1, 3}]], scale[#[[2]]]]} & /@ d00, Frame -> True]

```

[![enter image description here](https://i.stack.imgur.com/xcTVs.png)](https://i.stack.imgur.com/xcTVs.png)