GenericMappingTools / GenericMappingTools/gmt

Inset within subplot panel fails

Open
#6,415 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

As reported on the [forum](https://forum.generic-mapping-tools.org/t/the-inset-picture-doesnt-displayed/2677), **inset** used in subplot panels fails in terms of placement. Clearly the -Dj setting is computing strange placement coordinates. In the original post, the BR box was plotted way to the right and later covered up by other plots.

A simple example contrasts plain inset versus inset inside a panel:

```
#!/bin/bash
# Shows problem with inset within subplot panel
gmt begin
gmt figure inset_in_panel png
gmt subplot begin 1x1 -Fs5c/4c -A
gmt subplot set 0
gmt coast -R70/138/13/56 -Glightgray -B
gmt inset begin -DjTL+w0.5c/0.8c+o0.1c -F+p1p,red
gmt inset end
gmt subplot end

gmt figure plain_inset png
gmt coast -R70/138/13/56 -Glightgray -B -JQ5c
gmt inset begin -DjTL+w0.5c/0.8c+o0.1c -F+p1p,red
gmt inset end

gmt end show
```

Only showing the failing inset_in_panel plot here (the other is fine):

![inset_in_panel](https://user-images.githubusercontent.com/26473567/156923887-0753e3bf-72c1-4c9e-9146-60f435234c7e.png)

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.