Begin cleanup for setYAxes()

Fix some caching, simplify readability, fix style issues.
Finish cleanup for setYAxes()

Fixes a bug where the title positioning is incorrect if more than one
axis is plotted.