Charlotte Perkins Gilman wrote "The Yellow Wallpaper" as an indictment of the "rest cure," which, during Gilman's lifetime, was a common treatment given to women suffering from disorders that in the present world would be defined as forms of anxiety and depression. Under the rest cure, women were required to severely limit their activities, including reading and visiting with or even writing letters to family and friends, and they were ordered to spend the vast majority of their day in bed. Perkins herself was prescribed the rest cure during a severe bout of what would now be recognized as postpartum depression. She found that such extreme restriction of activities stripped her life of meaning and did her much more harm than good. Because Gilman's goal was to illuminate the adverse effects of this type of treatment, her choice to restrict the setting to one room is integral to the story's message and the best way to show the maddening, skin crawling effect such confinement and social isolation would have on a person, especially one who was already in an emotionally fragile state. The setting is anything but boring and instead lends itself to suspense and elements of psychological horror.
Some specific ways Gilman builds suspense and terror into her story, via the single room setting, include:
The gothic, foreboding description of the room, which is meant to emphasize the feeling of confinement. It contains barred windows, a splintered floor, an iron bed that has been nailed to the floor, and of course, the ripped worn wallpaper of the title.
The room itself begins to drive the woman from merely depressed to actually mad. With nothing to do all day except secretly writing in a forbidden journal, she resorts to staring at the hideous pattern. Its pattern begins to take on disturbing shapes in her mind reminding her of macabre human faces and in one spot of a strangled infant. The sickly yellow color drives her crazy and, in her confused state, it seems to change shades and eventually she even hallucinates strange odors coming from it. She eventually begins to see a woman, her "double," in the pattern of the wallpaper. She imagines the woman is trapped in the walls of the house and trying, but failing, to break through the paper.
Although the action takes place entirely inside the room in which the narrator is imprisoned, she can glimpse a beautiful garden through the bedroom window. It's lush and beautiful, filled with "old fashioned flowers" and "mysterious deep shaded arbors." In the nineteenth-century, garden imagery like this was often used by women authors to depict feminine power and creativity, something which the narrator of the story has been denied in her extreme confinement.