Electrostatic potential of the system along z dirrection of the simulation box

Hi

I want to claculate the electrostatic potential along the Z dirrection. What will be the best way to go for that?

With regards
Chintu Das

Calculating 1D electrostatic potential profile from MD simulations – Alta Fang – note the LAMMPS input script is missing ave none in the fix ave/chunk.