# getting data from histogram using python script.

**URL:** https://discourse.paraview.org/t/getting-data-from-histogram-using-python-script/924
**Category:** ParaView Support
**Created:** [November 16, 2018, 4:24pm UTC](https://discourse.paraview.org/t/getting-data-from-histogram-using-python-script/924 "2018-11-16T16:24:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![senthilathiban](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@senthilathiban](https://discourse.paraview.org/u/senthilathiban)
#### Post date: [November 16, 2018, 4:24pm UTC](https://discourse.paraview.org/t/getting-data-from-histogram-using-python-script/924/1 "2018-11-16T16:24:17Z")

</div>

Hi,

I have a openfoam simulation with lagrangian data. I need to count the number of particles in a zone. I have done this using sphere clip and histogram. The histogram produces one row with diameter and number of particles. Now I want to automate this process, as there are many regions.

I have created a script and ran it as macro.

writer = CreateWriter(‘data.csv’)  
writer.UpdatePipeline() // result from 1st region  
clip1.ClipType.Center = [0.2, 0.2, 0.36]  
clip1.ClipType.Center = [0.2, 0.2, 0.36] //changing the clip location  
barChartView1.Update()  
writer.UpdatePipeline() // result from 2nd region

but the file has only the last result. I want the data to be appended to the same file row by row. Is there any other way.
