Dear all, 

I have a line plot of some parameter along an axis as a function of distance. Now I would like to get another line plot of the same parameter but averaged over a certain distance (say 100 kpc, the plot below is supposed to be flat after this). I've been searching the document for some time but haven't found a method. Is there a simple way to do this? 

I would very much appreciate it if anyone could help me on this. 


===================================
import ...

def _ScaledBMag(field, data):

    return ...


....

pf = load(filename)

    add_field("ScaledBMag", function=_ScaledBMag)


    c = pf.h.find_max('ScaledBMag')[1]

    ax = 0

    ray = pf.h.ortho_ray(ax, (c[1], c[2]))

    

    P.subplot(211)

    P.semilogy(ray['x'], ray['ScaledBMag'])

    P.xlabel('x')

    P.ylabel('ScaledBMag')

    print "works"

    P.savefig("ScaledBMag_lineplot.png")


Inline image 1

===================================

I'm using yt

Version = 2.6.1

Changeset = c994959ed3be

===================================



Regards,

Dai