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/']
Just some variants:

```
l = RandomReal[{-4, 4}, {200, 3}];
With[{g = #[[All, {1, 3}]] & /@ GatherBy[l, #[[2]] < 2 &]},
 ListPlot[g, PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]]
ListPlot[Last@Reap[Sow[{#1, #3}, #2 < 2] & @@@ l, _, #2 &], 
 PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]
ListPlot[GroupBy[l, #[[2]] < 2 &, #[[All, {1, 3}]] &], 
 PlotStyle -> {Red, Green}, PlotMarkers -> {Automatic, 8}]

```

Outputs:

[![enter image description here](https://i.stack.imgur.com/s8rcQ.png)](https://i.stack.imgur.com/s8rcQ.png)
**ListPlot with styled data**

```
styleddata1 = With[{ps = Rescale[#2, Through[{Min, Max}@d00[[All, 2]]], {5, 20}]},
    Style[Tooltip[{#, #3}, #2], If[-2 <= #2 <= 2, Directive[Green, AbsolutePointSize[ps]], 
       Directive[Red, AbsolutePointSize[ps]]]]] & @@@ d00;

ListPlot[styleddata1, AspectRatio -> 1]

```

![Mathematica graphics](https://i.stack.imgur.com/hC016.png)

**BubbleChart with styled data**

```
styleddata2 = Style[Tooltip[{#, #3,
         Rescale[#2, Through[{Min, Max}@d00[[All, 2]]], {0.05, 1}]}, #2], 
         If[-2 <= #2 <= 2, Green, Red]] & @@@ d00;

BubbleChart[styleddata2]

```

![Mathematica graphics](https://i.stack.imgur.com/xSnAO.png)