density along x direction

Dear All user,

I am simulating a system that is included CO2 and H2O.
How can I compute CO2 density profile along x direction?

Thank you,