From Smithsonian:
Writers are often told to write what they know, so it should come as no surprise that many of the most famous characters in literary history are based on real people. Whether drawing inspiration from their spouses, friends and family, or finally, after decades worth of work, inserting themselves into the text, authors pull nearly every word and sentence from some element of reality, and most often, that element is people. Many characters, like Dean Moriarty in Jack Kerouac’s On the Road (based on real-life beatnik Neal Cassady), come to mind as obvious, but this list is for the real-life literary characters that do not get recognized enough, and who deserve as much credit as their fictional counterparts.
1. Prospero (The Tempest, 1611)/William Shakespeare
Considered Shakespeare’s last play, The Tempest is the artist’s farewell to the theater. Prospero is the island’s great magician, and with his powers he controls the tortoise-like character of Caliban and the sprite, spry Ariel. Prospero’s magic is in his books, and he decides when the Tempest should arrive, and who should come along with it. Sounds an awful lot like a playwright, doesn’t it? Prospero writes the script and wonders, like Shakespeare understandably would, what the future will be without him and his power. With frequent allusions to “the Globe” (the world, but also the name of Shakespeare’s theater), it is difficult to miss Prospero’s likeness to his great creator. Shakespeare critic and scholar Stephen Greenblatt says that the play brings up all of the “issues that haunted Shakespeare’s imagination throughout his career.” By writing himself into his final play, Shakespeare reminded the world of his own immortality as a public literary figure.
…3. Dorian Gray (The Picture of Dorian Gray, 1890)/ John Gray
A member of Oscar Wilde’s lively literary circle, John Gray was a lovely, boyish poet who could pass for a 15-year-old at age 25. In The Picture of Dorian Gray, Wilde describes the youth as a “young Adonis,” and judging by a black-and-white photo of John Gray, we can only suggest that he was not far off. Wilde met Gray in London at the home of a fellow artist, and, for a while was one of the author's many romantic affairs. The similarities between Gray the character and Gray the poet were striking. Like Dorian, John Gray found himself easily corrupted by the city and the title character’s first name came from an ancient Greek tribe, the Dorians, who were famous for perpetuating love among men. After the publication of The Picture of Dorian Gray people began to call John Gray Dorian, which made him so uncomfortable that he went so far as to sue a London publication for libel for making the association. The fate of this real-life hero was more dramatic than Wilde could have ever written: John Gray moved to Rome and studied for the priesthood.
More here.