Symbolism, Imagery, Allegory
Most of this story takes place in the captain's cabin because it's the only place on his ship where Leggatt can hide himself. Along with being a handy hiding place, the cabin also symbolizes the captain's separation from the rest of his crew. You can tell how obsessed the captain is with his cabin by how specifically he describes it to us, as in passages like this:
It must be explained here that my cabin had the form of the capital letter L, the door being within the angle and opening into the short part of the letter. (1.71)
He's also quick to note that this shape to his room makes part of the room invisible to someone in the doorway:
"But anyone opening it, unless he stepped right inside, had no view of what I call the long (or vertical) part of the letter" (1.71).
Hold your breath, because we're about to get deep in here: In this sense, the cabin is like the captain himself—the most important part of it is invisible to his crewmates.