Skip to content

Different alignment options for map titles (-B+t+s) #7106

@KristofKoch

Description

@KristofKoch

See this forum thread for context.

Currently the plot titles are always centered. Other alignments like top right as seen in the following mockup are desirable.

map_style_hi

Currently this has to be done with manually placed text. This is difficult when the plot width is not known (e.g. when using a map scale) or the absolute position of the map border on the plot is unknown (e.g. when using annotations outside the map borders). @PaulWessel suggested a new default setting MAP_TITLE_JUST which would allow for maximum flexibility as imagined below:

-B+t justify

A --MAP_TITLE_JUST=TR would align the title to the upper-right position as seen in the first figure above.

Minimum code for a simple plot to play with:

gmt begin title_alignment
  gmt coast -RUS.HI+e1 -W0.7p,black -B+f -Bg --MAP_FRAME_TYPE=plain \
    -B+t"HAWAIIAN ISLANDS"+s"Pacific Ocean"
gmt end show

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions