Placement
Legends need to be within or nearby the map element with which they are associ‑
ated. Legends can be placed outside of the map element, in the margin, in either of
the following two cases: if there is only one map element on the layout or if all map
elements on the layout share a common legend. If there are multiple map elements
with different features on each, it is not always clear which legend goes with which
map unless the legend is superimposed on its map element. When placed inside
the map element it ought not to obscure the underlying data and is often therefore
placed in areas that are not important to the map’s purpose such as on the ocean for a
terrestrially focused map or on the land for a marine‑centered map. In such instances
a background box is often needed to provide uniform background color on which to
set the text.