rd	1	#
		da $1
		lines 1 1
		read {_nx 1 _ny 2 _nz 3 t 4 _Lx 5 _Ly 6 _Lz 7}
		define nx (_nx)
		define ny (_ny)
		define nz (_nz)
		lines 2 10000000
		read {i 1 j 2 k 3}
		read {rho 4 }	
                # fix
		read {vx 5 vy 6 vz 7}
		read {bx 8 by 9 bz 10}
		set ptot = rho + 0.5*(bx*bx + by*by + bz*bz)
                expand 1.5
                lweight 3
xavg    2       #
                rd $1
                #
                set avg = 0,$nx-1
                set avg = avg*0.
                do I=0,$nx-1 {
                        echo $I
                        set tmp = $2 if(i == $I)
                        set avg[$I] = sum(abs(tmp))/dimen(tmp)
                }
                set I = 0,$nx-1
                limits I avg
                erase
                location $($gx1 + 2000) $($gx2 + 600) $gy1 $gy2
                box
                connect I avg
                location $($gx1 - 2000) $($gx2 - 600) $gy1 $gy2
                #
yavg    2       #
                rd $1
                #
                set avg = 0,$ny-1
                set avg = avg*0.
                do I=0,$ny-1 {
                        echo $I
                        set tmp = $2 if(j == $I)
                        set avg[$I] = sum(tmp)/dimen(tmp)
                }
                set I = 0,$ny-1
                limits I avg
                erase
                box
                connect I avg
                #
zavg    2       #
                rd $1
                #
                set avg = 0,$nz-1
                set avg = avg*0.
                do I=0,$nz-1 {
                        echo $I
                        set tmp = $2 if(k == $I)
                        set avg[$I] = sum(tmp)/dimen(tmp)
                }
                set I = 0,$nz-1
                limits I avg
                erase
                box
                connect I avg
                #
plz	3	#
		rd $1
		#
		set var = $2 if(k == $3)
		set ip = i if(k == $3)
		set jp = j if(k == $3)
		limits i j
                ticksize 0 0 0 0 
		box
		image($nx,$ny)
		set image[ip,jp] = var
		minmax min max echo $min $max
		set lev = $min,$max,($max-$min)/20.
		levels lev
		contour
		#
ply	3	#
		rd $1
		#
		set var = $2 if(j == $3)
		set ip = i if(j == $3)
		set kp = k if(j == $3)
		limits i k
                ticksize 0 0 0 0
		box
		image($nx,$nz)
		set image[ip,kp] = var
		minmax min max echo $min $max
		set lev = $min,$max,($max-$min)/20.
		levels lev
		contour
		#
plx     3       #
                rd $1
                #
                set var = $2 if(i == $3)
                set jp = j if(i == $3)
                set kp = k if(i == $3)
                limits j k
                ticksize 0 0 0 0
                box
                image($ny,$nz)
                set image[jp,kp] = var
                minmax min max echo $min $max
                set lev = $min,$max,($max-$min)/20.
                levels lev
                contour
                #
plyz   4        #
                rd $1
                set var = $2 if((j == $3)&&(k ==$4))
                set ip = i if((j == $3)&&(k==$4))
                limits ip var
                ticksize 0 0 0 0
                box
                connect ip var
                # 

