Skip to content

Wrong annotation and gridline positions for rounded values #8490

Closed

Description

@yvonnefroehlich

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
frame_small_area_basemap

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)
frame_small_area_tilemap

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

Activity

  1. added
    bug
    on May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions