There are several options:
Set
Prefs.verticalProfile
totrue
:import ij.IJ; IJ.run("Profile Plot Options...", "width=450 height=200 minimum=0 maximum=0 vertical interpolate draw");
or, on a lower level:
import ij.Prefs; Prefs.verticalProfile = true;
Enable Vertical profile in the Edit > Options > Profile Plot Options... dialog:
You can use a line selection with adjustable thickness. Press Shift while creating the selection to keep the line strictly vertical.