Optimisation: revisited the reference plane grid code; it is now
reasonably optimised and draws longer lines where it can (rather
than drawing lots of short lines of the same color)