x coordinate along one line

Hello, I want to make a line in the slice as a x coordinate axis, and the Y-axis will change accordingly. how could I get this?

With best regards