If you were to ask what place in Britain has inspired most writers, you would probably guess London; Devon comes a close second. So many authors past and present have been drawn to (and have drawn on) the county that it is arguably one of the most fertile places in Britain for writers to live, visit or set their work in.

Both a heaven of beauty and inspiration and a hell of damp and dullness, Devon was described by Ted Hughes in a letter as “notorious for … Decomposition of the will. All the electrical points rust up. Moss grows in under the toenails.” Yet it haunts the creative imagination, both as the safe tranquil place from which Nicholas Nickleby is exiled and as the scene of one of our most sinister novels, The Hound of the Baskervilles.

The county is unique in having two very different coastlines, and one key to its appeal is its variety of climates. For while south Devon is a place of lush, semi-tropical warmth, both Dartmoor and the north coast are lashed by the Atlantic sea. Extreme contrasts work like the cathode and anode in a battery. If the energy of London springs from the gulf between rich and poor, that of Devon grows out of its granite tors, soft water, hidden valleys and blood-red soil. It feels like Narnia, or, as one of my characters says, “a separate shamanic space”, which is both very real and quite extraordinary.

Most famously, it is to this county that Jane Austen’s Dashwood sisters come in Sense and Sensibility. They take their rental cottage for 12 months, cheered by its “pleasant fertile spot”, only to fall in love. Where else would two very different young women – self-restrained, rational Elinor and tempestuous, romantic Marianne – each find a home, or a husband?

The sisters are only four miles from Exeter, where EM Delafield would set the genteel comedies of Diary of a Provincial Lady just over a century later, but north Devon is another matter. Associated with dark deeds ever since RD Blackmore’s Lorna Doone, “the heiress of this mad domain”, its two rivers are home to Tarka the Otter, hunting in savage riparian bliss. Both Mary Norton (The Borrowers), and Charles Kingsley (The Water Babies), were Bideford authors whose imaginations were also steeped in wateriness. So, too, is Tanya Landman. Her Carnegie-winning Hell and High Water is based on a true story about a Bideford mayor, Thomas Benson, and the Nightingale scandal of 1752.

In the middle of Devon is that great wilderness of moor and tors, “so vast, and so barren, and so mysterious”, of Arthur Conan Doyle’s The Hound of the Baskervilles. Even without pursuit by a gigantic hound, Dartmoor is routinely depicted as haunted: small wonder that Catherine Fisher’s sinister Chronoptika quartet was set there, as was Mal Peet’s The Murdstone Trilogy, his satire on Tolkien and literary failure. Stone Age settlements, mist and howling winds make it a gift.

The milder, sunnier climate of the south coast has attracted a different breed of writer, from Austen and John Keats to George Eliot and Hilary Mantel. It is known as the English Riviera, and its affluence is just as sinister. At least 15 of Agatha Christie’s murder mysteries are set in and around Torquay (or “Redquay”), where greed and respectability are powerful motives for crime. To Christie, born in the town, every cove seems to have presented opportunities for violence, so that merely catching the 4.15 from Paddington was enough to invite strangulation.

Contemporary novelists focus on Devonian squalor with the same enthusiasm as Thomas Hardy (whose Jude the Obscure was triggered by an advertisement in Exeter.) Both Tim Pears’s In the Place of Fallen Leaves and The Horseman depict the poverty of his native Dartmoor. Philip Hensher’s King of the Badgersjuxtaposes a “pleasant, attractive, functioning little town” rather like Topsham, with its squalid, impoverished suburb where very bad things happen. Joanna Briscoe’s You, drawn from her own childhood in Moretonhampstead, describes the disturbing clash between the hippy lifestyle and academic ambition. Mary Wesley’s comedies at least see its coves as settings for al fresco upper-class sex rather than murder: no wonder her image appears on the Totnes £1 note.

Devon has plenty of real people with real problems, many of whom voted for Brexit in the hope of some change. Elizabeth Goudge’s classic novels, The Little White Horse and The Runaways celebrate its beauty, natural magic and tolerance of eccentricity. Tim Bowers, Philip Reeve, Babette Cole and Michael Morpurgohave drawn on this too: indeed, Morpurgo’s War Horse came from a true story he heard from a first world war veteran in his local pub in Iddesleigh.

Above all, many place names will be familiar to Harry Potter fans. JK Rowling, graduate of the University of Exeter, used so many for her wizarding world that it was no surprise to find a hamlet near us called Quoditch; there is a real village called Chudleigh (as in the quidditch team the Chudley Cannons). The name of Ottery St Catchpole, the home of the Weasley, Lovegood and Diggory families, is close to the real town of Ottery St Mary. In a place where it’s not unusual to see real stickers announcing that “this car is protected by witchcraft”, or be stopped by a herd of snowy llamas trotting down a lane wearing garlands, it is entirely appropriate that Rowling’s Muggles and wizarding families can live in peace together.

Inevitably, the clash of climate and temperament made Devon the setting for my seventh novel, The Lie of the Land. My warring metropolitan couple can’t afford to divorce, and move there from London to a rental house, which, unknown to them, has been the scene of a violent crime. Their quarrel is due to infidelity and a clash of personalities, but it becomes one about two contrasting visions of a county that I myself have loved since childhood. Only Devon could contain such contradictions, and only a novel set there could hope to resolve them.