Preserve tick ordering when updating axis.

Fixes #1748.