Wrong annotation and gridline positions for rounded values
Description of the problem
In case the longitude and latitude values which are used for the annotations and gridlines of the map frame are rounded by GMT, they are placed incorrectly, as their positions are not adjusted accordingly to the rounding effect (see middle map in the example below). This is especially problematic for small study areas and leads to misleading maps. Annotations and gridlines are only placed correctly if steps are specified (see the right map).
Edit 2024/05/24: Also set a fixed step of 0.0025 for the ticks (f) for the right map, to make the white and black areas of the fancy frame match the major ticks.
Full script that generated the error
gmt begin frame_small_area_basemap_gmt
gmt basemap -R-157.84/-157.80/21.255/21.285 -JM8c -Bafg --FORMAT_GEO_MAP=ddd.xxxF
gmt basemap -R-157.84/-157.80/21.255/21.285 -JM8c -Bafg --FORMAT_GEO_MAP=ddd.xxF -Xw+2c
gmt basemap -R-157.84/-157.80/21.255/21.285 -JM8c -Ba0.01f0.0025g0.01 --FORMAT_GEO_MAP=ddd.xxF -Xw+2c
gmt end show
Actual outcome
Same study area with background map plotted via pygmt.Figure.tilemap
(modified from https://www.pygmt.org/dev/gallery/maps/tilemaps.html, last access 2024/05/16)
Expected outcome
For the middle plot, the gridlines and annotations should be moved to the position of the rounded values.
System information
- Operating system: Windows | Linux
- GMT version (
gmt --version): 6.5.0 | 6.4.0