# Make a conditional plot?

**URL:** <https://community.wolfram.com/t/make-a-conditional-plot/12887>\
**Category:** Questions\
**Tags:** graphics-and-visualization\
**Created:** [July 25, 2018, 11:58pm UTC](https://community.wolfram.com/t/make-a-conditional-plot/12887 "2018-07-25T23:58:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnabkhan007](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@arnabkhan007](https://community.wolfram.com/u/arnabkhan007)\
**Post date:** [July 25, 2018, 11:58pm UTC](https://community.wolfram.com/t/make-a-conditional-plot/12887/1 "2018-07-25T23:58:57Z")

</div>

Hi, i want to make a plot like this type:

```
If[Abs[angle1] < 10, ListPlot[angle1]]

```

How is it possible to do with Mathematica?

---

<div class="post-metadata">

**Author:** ![chaiselongue](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/chaiselongue/32/25455_2.png) [@chaiselongue](https://community.wolfram.com/u/chaiselongue)\
**Post date:** [August 1, 2018, 6:17pm UTC](https://community.wolfram.com/t/make-a-conditional-plot/12887/2 "2018-08-01T18:17:35Z")

</div>

That’s a way

```
ListPlot[RandomReal[{-20, 20}, 100] /. x_Real :> If[Abs[x] > 10., 0, x], PlotRange -> {Automatic, {-11, 11}}]

```

please note, if `angle1` is a list (because it appears in `ListPlot[]`) then `Abs[angle1]` threads over the list `angle1` and `Abs[angle1] < 10` is meaningless and comes back unevaluated. Just try subexpressions before using them:

```
In[9]:= l = {1, -2, 3, -4, 5, -5, 7};

In[10]:= Abs[l]
Out[10]= {1, 2, 3, 4, 5, 5, 7}

In[11]:= Abs[l] < 10
Out[11]= {1, 2, 3, 4, 5, 5, 7} < 10

```
