"Don't stare – it's rude." Every child must have been told that, and most of us by adulthood have curbed our natural instinct to gaze curiously and openly at other people. Perhaps that helps to explain the allure of portraits: they give us licence to stare.
A face is of course much more than a set of features; it is, or can be, a fascinating character map. On a recent wander around the National Portrait Gallery, I came face to face with Henry VII's air of calculating shrewdness, his granddaughter Elizabeth I's haughtiness and Oliver Cromwell's self-righteous determination.
Occasionally, though, a portrait can be disconcerting, and you almost have to avert your gaze. It's as if the licence to stare applies to the sitter as well as the viewer. Lady Ottoline Morrell looks down at you from her frame with a witty, aristocratic sneer, making you feel slightly uncomfortable, even judged, and I always feel that the eyes of the emaciated Cardinal Newman are following me around the room, perhaps sensing my past misdeeds like a confessor.
With other portraits you have the feeling that it's not you the sitter is interested in, but the painter: 20-year-old Emma Hamilton, her head modestly swathed in white muslin and tilted demurely a la Princess Diana, is surely flirting with George Romney – or maybe it's just that he was in love with her. Then there are the sitters who appear unaware of either painter or viewer, being too intent on the piano they are playing or the book they are reading.
More intriguing are those who make you wonder: an example is the chalk drawing by Dante Gabriel Rossetti of his sister Christina and their mother. Pictured in profile, the two women gaze seriously and pensively in the same direction. They are deep in thought – but about what, you long to know.
Often our natural curiosity about people extends to their taste. Their clothes interest us, and so do their surroundings. I'm sure I'm not alone in my fascination with other people's rooms. I love walking along a residential street, especially as dusk falls and lights are switched on, and taking a sneaky glimpse into the basement or ground-floor windows. But again, it doesn't do to stare, or at any rate to be caught doing so. So I really like those portraits in which the sitter is in their own home or workplace, such as the one of the Victorian playwright and novelist Charles Reade. The painting shows Reade writing busily in his sitting room, with its red curtains and rugs and dark oak furniture, while a cat sleeps and a white dog waits patiently for his master to reach a good stopping place and take him out through the open French windows into the lush greenery and the possibly brewing storm.
More stilted but nevertheless compelling (since people have always been nosy about royalty) is the painting entitled Conversation Piece at the Royal Lodge, Windsor, in which George VI is depicted having tea with his wife and daughters. Instead of the usual formal royal group-portrait, we see Queen Elizabeth (later the Queen Mother) pouring the tea while Princess Margaret leans forward with her arms on the table and Princess Elizabeth, about to take a seat, looks quizzically at her father, who seems to be considering what to say next. I like the mixture of formality and relaxation: the room, with its lace tablecloth, lilies and gold-framed pictures, is quite prim and proper, but behind the off-duty king's chair a dozing corgi softens the scene, conveying the message that this is a real family with pets. (I've read that the artist, James Gunn, drew this dog as a movable cut-out and repositioned him several times.)
A room can do more than give us a glimpse into the sitter's everyday surroundings; it can help to create a mood. I find one of the most touching interiors in the NPG collection is that of John Keats's house in Hampstead, north London. This is a retrospective portrait, painted by Keats's great friend Joseph Severn after the poet had died (in Severn's arms). Severn wrote: "After the death of Keats the impression was so painful on my mind that I made an effort to call up the last pleasant remembrance … This was at the time he first fell ill & had written the Ode to [a] Nightingale [1819] on the morning of my visit to Hampstead. I found him sitting with the two chairs as I have painted him & was struck with the first real symptoms of sadness in Keats, so finely expressed in that poem." Even without the benefit of Severn's commentary, the viewer is struck with a sense of melancholy beauty: the shadows of the two chairs and of the soulful-looking Keats contrasting with the brightness of the open book on his lap and the inviting beauty of the garden outside the open door.
A more recent painting in which surroundings illuminate character is that of the pioneering chemist Dorothy Hodgkin by Maggi Hambling. In this 1985 portrait, the snow-reflected light from a casement window falls on a mass of papers, books and files, while in the foreground is a complicated model of the structure of insulin, consisting of dozens of interlinked beads and wires. All of this heightens our awareness of the sitter's complex thought-processes, as her arthritic hands (each one painted double, to indicate the speed of her mind and the intensity of her passion for scientific discovery) race across the paper on which she is sketching a diagram.
Another, much starker favourite of mine is James Lloyd's 2012 portrait of Maggie Smith. No background objects or ornaments here: the electric cable and the pipework in the bare room are exposed and there is a crack in the wall, while Dame Maggie herself wears a plain floppy grey jacket and black trousers. There is sadness as well as warmth in her expression, and the message that comes over is one of honesty: there is no attempt at embellishment or cover-up – this is who I am.
Nothing could be in stronger contrast to the flattering "Ditchley" portrait of Elizabeth I, with her sumptuous embroidered dress, lace ruff, strings of pearls and improbably smooth hands, standing omnipotently on a globe of the world. There are, in fact, relatively few detailed pictures of interiors in the National Portrait Gallery. More commonly the backgrounds of these paintings of eminent people are plain and sombre, or else symbolic. Charles I stands beside his crown and sceptre against a backdrop of royal red velvet. Christopher Wren holds a compass and rests his arm on a table where the plan of St Paul's Cathedral is laid out. Stephen Hawking is depicted against a blackboard covered in an impressive array of symbols and equations.
Then there are those paintings combining portrait and landscape: I love the one of Beatrix Potter sporting an umbrella and a green felt hat with a Lakeland scene behind her, complete with farmworkers and rams. (She bought a farm with the proceeds of her children's books and became a prizewinning sheep-breeder.)
In the annual BP portrait award exhibition, the percentage of backgrounds showing detailed rooms is usually much higher than in the main gallery. I assume this is because the paintings entered for the award tend to be "portraits of affection", often of family members, friends and neighbours rather than of renowned achievers. In 2012 I had the privilege of wandering around the exhibition with the artist Peter Monkman, who had won first prize three years previously for his portrait of his daughter, Changeling 2.
Peter had been commissioned by the gallery to paint me, and this was the first time we had met. He gave me a lot of insight into the art of portraiture, and I think he also picked up on my weakness for pictures of rooms. At any rate, when he later came to visit me in Glasgow to do some preliminary sketches, he was very taken with my "props room". This is the smallest room in my house, with floor-to-ceiling shelves on three of its walls. The shelves are crammed with the props I use when acting out my stories at book festivals and in theatres. This performance aspect of my work means a lot to me – probably as much as the writing itself – but I had rarely been able to interest any visiting journalists in the props room or get photographers to snap me there. They would usually take a cursory glance and then say: "I see – and can you tell me, what gave you the idea for The Gruffalo?" To my delight, Peter clearly thought the shelves would make a suitable background, at once illuminating and mysterious. I didn't want it to be too obvious what the different objects behind me were. It would have seemed a bit corny and condescending to show a children's author with a mermaid, a witch's hat, a monkey puppet and so on. To my relief Peter agreed, and was happy for me to turn some of the things around, presenting just a glimpse of the Gruffalo's purple prickles, the mermaid's blue shimmering tail and the tresses of the ghost's disembodied head; the idea was that these should come across as glimpses into my imagination, as well as providing interesting colours and textures.
I think it was Peter's idea for me to be holding a notebook and pencil, as if I might be writing a story about the viewer. I'd never had my portrait painted, but since I absolutely hate lengthy photoshoots I wasn't entirely looking forward to the experience. I imagined I wouldn't be allowed to twitch a muscle, and I also had a terror of feeling bored, since sitting still and unoccupied is not something I normally do. If I haven't got a book, a crossword or a game of sudoku, I tend to panic. In fact the whole procedure was surprisingly enjoyable. On that visit to my house Peter did some quick sketches and took some (mercifully even quicker) photos as a way of becoming acquainted with my features, and perhaps, too, as a way of getting to know me, since we talked quite a lot. When I next saw him, several months later in his studio, he'd already painted a lot of the portrait using the sketches and photos. He then needed me to do four two-hour sittings over two days, so he could change some things, add some details and paint my hands. This time I had to remain even more still, but I found it was soothing to be able to fix my gaze on a picture on his wall and contemplate it at length, while listening to hours of Radio 4.
I had imagined that I would feel uncomfortable looking at the finished portrait – perhaps because it's life-size and I am someone who studiously avoids mirrors. In fact this is not the case. I feel detached rather than self-conscious, though it's quite different from looking at other sitters, because the experience lacks that ingredient of curiosity.
So now you have licence to stare at me. But I warn you that I am one of the ones who stare back, as my pencil hovers above my notebook: I may not feel curious about myself, but I am curious about you.
• The National Portrait Gallery's BP portrait award exhibition, London WC2, will run from 26 June to 21 September.