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/']
Basically a duplicate of [this question](https://mathematica.stackexchange.com/questions/105574/plotmarkers-shadows-the-settings-by-style).

You can just style each point before you pass them to `ListPlot` for things like this.

Define a color function:

```
cfun = Piecewise[{{White, # <= -2}, {Green, -2 < # < 2}, {Red, # > 2}}, Black] &

```

Then style by second element:

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

ListPlot[d0, Background -> Lighter[Gray, 0.5]]

```

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

**Also Specifying PlotMarkers**

Using the `PlotMarkers` option will mask the `Style` definitions, unless you specify the undocumented:

```
Method -> {"OptimizePlotMarkers" -> False}

```

Like so:

```
GraphicsRow[{
  ListPlot[d0, PlotMarkers -> {Automatic, 5}],
  ListPlot[d0, PlotMarkers -> {Automatic, 5}, Method -> {"OptimizePlotMarkers" -> False}]
}]

```

[![enter image description here](https://i.stack.imgur.com/JaHjx.png)](https://i.stack.imgur.com/JaHjx.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)