fixing a regression issue with #1824. Also removing duplicate code
Merge pull request #1837 from stormpython/fix/y_axis

Fixing a regression issue with #1824. Also removing duplicate code