Utkarsh,<div><br></div><div>Thank you very much. That is exactly what we were looking for. I just knew that there had to be a way to do it using the "Programmable Filter" but I didn't know how!</div><div><br></div><div>Cheers, and thank you again for your help.<br><br><div class="gmail_quote">On Mon Jan 12 2015 at 5:07:53 PM Utkarsh Ayachit <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Before some yells at me for using bad code for type conversion :),<br>
here's a better code:<br>
<br>
import numpy<br>
sum = numpy.sum(inputs[0].RowData["<u></u>bin_values"])<br>
array = inputs[0].RowData["bin_values"<u></u>].astype(numpy.float32)<br>
array = 100.0*array/sum<br>
output.RowData.append(array, "bin_values")<br>
output.RowData.append(inputs[<u></u>0].RowData["bin_extents"], "bin_extents")<br>
<br>
On Mon, Jan 12, 2015 at 2:01 PM, Utkarsh Ayachit<br>
<<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>> wrote:<br>
> You could do this using a Python Programmable Filter.<br>
><br>
> Here's a script to use:<br>
><br>
> import numpy<br>
> sum = numpy.sum(inputs[0].RowData["<u></u>bin_values"])<br>
> array = 1.0 * inputs[0].RowData["bin_values"<u></u>]<br>
> array = 100.0*array/sum<br>
> output.RowData.append(array, "bin_values")<br>
> output.RowData.append(inputs[<u></u>0].RowData["bin_extents"], "bin_extents")<br>
><br>
> Attached is a state file.<br>
><br>
> Utkarsh<br>
><br>
> On Wed, Jan 7, 2015 at 1:03 PM, Ethan Hereth <<a href="mailto:e.a.hereth@gmail.com" target="_blank">e.a.hereth@gmail.com</a>> wrote:<br>
>> Good afternoon and happy new year!<br>
>><br>
>> I have a colleague who would like to be able to plot the relative frequency<br>
>> of the histogram data instead of absolute bin count. I.e. instead of having<br>
>> the left axis say there are 100 things in bin one, he'd like for it to say<br>
>> that 5% of the things are in bin one.<br>
>><br>
>> Is this possible?<br>
>><br>
>> Thank you!<br>
>><br>
>> --<br>
>> Ethan Alan Hereth<br>
>><br>
>> ______________________________<u></u>_________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the ParaView Wiki at:<br>
>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/<u></u>ParaView</a><br>
>><br>
>> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=<u></u>ParaView</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/<u></u>mailman/listinfo/paraview</a><br>
>><br>
</blockquote></div></div>