Significantly improve line labelling algroithm used for contour plots