# plotSelectionOverTime, trace,Extractselection

**URL:** https://discourse.paraview.org/t/plotselectionovertime-trace-extractselection/6028
**Category:** ParaView Support
**Tags:** python
**Created:** [December 10, 2020, 5:15pm UTC](https://discourse.paraview.org/t/plotselectionovertime-trace-extractselection/6028 "2020-12-10T17:15:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nikhil\_Nick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nikhil_nick/32/3230_2.png) [@Nikhil\_Nick](https://discourse.paraview.org/u/Nikhil_Nick)
#### Post date: [December 10, 2020, 5:15pm UTC](https://discourse.paraview.org/t/plotselectionovertime-trace-extractselection/6028/1 "2020-12-10T17:15:52Z")

</div>

> _QuerySelect(QueryString=‘(loc == max(loc))’, FieldType=‘POINT’, InsideOut=0)_
> 
> _#calculator1 is defined before, which returns a scalar namely “loc” that changes with time_
> 
> _SetActiveSource(calculator1)_  
> _extractSelection1 = ExtractSelection(Input=calculator1)_
> 
> _plotSelectionOverTime1 = PlotSelectionOverTime(Input=extractSelection1,_ Selection=None)\*

Why this code isn’t working. Is something wrong here? This lines are auto generated by paraview trace. But plotSelectionOverTime cannot able to select the active selection or it has some issues with cell selection from query. Anyone know, whats going on here…

cheers,  
nick.

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [December 11, 2020, 12:15pm UTC](https://discourse.paraview.org/t/plotselectionovertime-trace-extractselection/6028/2 "2020-12-11T12:15:52Z")

</div>

The correct code would be

> sel1=QuerySelect(QueryString=“(loc == max(loc))”, FieldType=“POINT”, InsideOut=0)  
> SetActiveSource(calculator1)  
> extractSelection1 = ExtractSelection(Input=calculator1, Selection=sel1)  
> plotSelectionOverTime1 = PlotSelectionOverTime(Input=calculator1, Selection=sel1)

---

<div class="post-metadata">

### Author: ![Nikhil\_Nick](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nikhil_nick/32/3230_2.png) [@Nikhil\_Nick](https://discourse.paraview.org/u/Nikhil_Nick)
#### Post date: [December 11, 2020, 1:36pm UTC](https://discourse.paraview.org/t/plotselectionovertime-trace-extractselection/6028/3 "2020-12-11T13:36:23Z")

</div>

Thanks, @jfavre, It worked like a charm. Thanks a ton.
