how to minimize the system with holding one atomic direction ?

Dear Lammps-user

I need to conduct the minimization of the system while fixing all the x positions of all atoms. How could I do that ?
Command minimize cannot do that directly.

"fix xx xx setforce 0.0 NULL NULL"before “minimize”

Hi Zhenxing

Thanks very much!