GenericMappingTools / GenericMappingTools/pygmt
pygmt.config: pen settings are not reverted correctly when set in a context manager
- Dominant language
- Python
- Stars
- 874
- Forks
- 255
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 40
Description
Haven't found time to see why it doesn't work.
Here is the minimal example:
```python
import pygmt
fig = pygmt.Figure()
fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
fig.shift_origin(xshift="w+1")
with pygmt.config(MAP_FRAME_PEN="4p,blue"):
fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
fig.shift_origin(xshift="w+1")
fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
fig.show()
```
The 3rd basemap is expected to have the default frame pen setting. Now the pen color is correct, but the pen thickness is incorrect:
| Actual | Expected |
|---|---|
|  |  |
The expected image is produced by:
```
gmt begin map
gmt basemap -R0/10/0/10 -JX10c -Baf
gmt basemap -R0/10/0/10 -JX10c -Baf -Xw+1c --MAP_FRAME_PEN=3p,blue
gmt basemap -R0/10/0/10 -JX10c -Baf -Xw+1c
gmt end show
```
Contributor guide
Assessment
This issue has not been assessed yet.