A portrait has always been an argument about who deserves a wall. For four centuries the argument was settled before the first sitting — by rank, by purse, by the sitter's power to commission the frame. Catherine Opie has spent thirty-five years reopening the case, and this summer in Edinburgh she gets to argue it in the grandest courtroom she has ever been offered.

To Be Seen, at the Royal Scottish Academy building until 1 November, gathers nearly eighty photographs made across three decades and threads them through seven rooms alongside thirteen paintings borrowed from the national collection — a sixteenth-century Madonna and Child among them, and a small Picasso from the Blue Period. The walls are blood-red and royal-blue. The building is William Henry Playfair's Greek Revival temple on the Mound, two hundred years old and columned like a promise. Into it walk Opie's people: the leather community of 1990s Los Angeles, high-school footballers, her own son at her breast.

The grammar of dignity

The show opens its case with Being and Having (1991): thirteen close-cropped faces of Opie's friends wearing false moustaches, set against grounds of saturated mustard, unsmiling, looking straight through you. Opie has always named Hans Holbein as the source of those single-hued backgrounds, and August Sander stands behind her frontal, level way of facing a person. The trick is older than photography and simpler than theory — formality confers dignity, and dignity is transferable. Paint a duke like a god and he reads as a god; photograph a drag king like a Holbein and the authority arrives just the same.

Then the argument turns on the artist herself. In Self-Portrait/Cutting (1993), a child's drawing — a house, two stick-figure women holding hands — is scratched into the skin of her back, photographed while it still weeps. Eleven years later she sits for Self-Portrait/Nursing, her son in her arms, the old wound faded to a pale ghost above him. Like Ana Mendieta's siluetas, these are documents in which the body is both author and evidence.

Not everyone kneels

When the exhibition ran at the National Portrait Gallery in London this spring, not every critic was persuaded. The Arts Desk saw melodrama in the old-master styling, a parody revealing less about the sitters than about the artist's own wish to be seen as significant; even the admiring Independent thought slightly too much was made of the Renaissance references. It is a fair charge to raise against any photographer who borrows velvet and chiaroscuro. But it mistakes where the work actually lives — not in the costume of art history, but in the levelness of the gaze.

Nothing is ever random

“I plan every exhibition very carefully,” Opie has said of the Edinburgh hang. “The architecture and the installation has to work with the meaning of the show. Nothing is ever random in my exhibitions.” Here the installation is the rebuttal. The borrowed Madonna does the arguing; the Picasso concedes the point. Hung between them, a portrait of a tattooed friend or a teenage linebacker stops being an intruder and becomes what it always claimed to be — the same genre, continued. The Guardian named it exhibition of the week; the show anchors this year's Edinburgh Art Festival while a sister presentation runs at the Fridericianum in Kassel.

The academy on the Mound spent its first two centuries helping decide who got a wall. Photography has been quietly revising such verdicts ever since — as other overlooked eyes have shown, the canon is mostly a record of who was allowed to look. Opie's answer is neither protest nor petition. She simply hangs her people at the height of the masters and lets the room get used to it. By the second gallery, it has.