by a hair vs by narrow margin

by a hair

by narrow margin

How often have the words by a hair and by narrow margin occurred in a corpus of books? (source: Google Ngram Viewer )