GenericMappingTools / GenericMappingTools/gmt

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

Open
#7,106 8 comments 1 reaction 0 assignees View on GitHub
feature request
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

_See [this forum thread](https://forum.generic-mapping-tools.org/t/different-alignment-options-for-b-t/3468) 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](https://user-images.githubusercontent.com/45796239/203652362-ea90dcac-170c-418a-88a1-a2c1d6929cf4.png)

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:

```bash
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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.