Helper function combineXY which makes both-scales functions from one-scale functions from each scale