GenericMappingTools / GenericMappingTools/pygmt

Figure.tilemap: handle longitude given as 0°-360°

Open
#2,591 3 comments 2 reactions 0 assignees View on GitHub
feature request help wanted
Dominant language
Python
Stars
874
Forks
255
Avg merge
1d 21h
Merged PRs (30d)
40

Description

`pygmt.Figure.coast` and the remote datasets (plotted via `pygmt.Figure.grdimage`) support that the longitude is given either as -180° to 180° East or as 0° to 360° East. However, it looks like the later longitude range is not supported by `pygmt.Figure.tilemap`. When plotting tiles for a region exceeding 180° East, the area after 180° East remains empty.

```python
import pygmt as gmt

region_lon360 = [120, 190, -48, -9]

fig = gmt.Figure()

fig.tilemap(
region=region_lon360,
projection="M10c",
zoom=2,
frame=["WSne+ttilemap", "af"],
)

fig.shift_origin(xshift="11c")

fig.coast(
region=region_lon360,
projection="M10c",
shorelines="1/1p,black",
water="steelblue",
frame=["wSne+tcoast", "af"],
)

fig.shift_origin(xshift="11c")

fig.grdimage(
region=region_lon360,
projection="M10c",
grid="@earth_relief_01d_g",
frame=["wSne+tremote dataset", "af"],
)

fig.show()
# fig.savefig(fname="tilemap_lon0to360.png")
```

_Output figure_:
![tilemap_lon0to360](https://github.com/GenericMappingTools/pygmt/assets/94163266/28080d11-8f19-4178-b019-38141dc5de1f)

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.