You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let inset begin accept -R and -J to automatically set width or height #5875
Currently, the user must use mapproject to determine the appropriate size for a inset to match a given region and projection. It would be useful to allow inset begin to accept the region and projection of the inset, similar to subplot begin, to avoid this extra step. Here is an example of the anticipated usage:
gmt begin test png
gmt grdimage @earth_relief -R-51/-48/-24/-23 -JM15c -B -Cworld
gmt inset begin -DjBL+o0.1c -F+p1p,black -R-80/-28/-43/10 -JM2c
gmt coast -Wthin -Swhite -Ggray
gmt inset end
gmt end show
Are you willing to help implement and maintain this feature? Yes
so -JM? finds that it needs to use a width of 2 * (2/2.20926717722) to fit inside the box. Now, I understand this is inconvenient and perhaps we can improve this, but the solution would be to ask for +w2c/2.20926717722c:
I guess one possible way to deal with this is to specify +w2c/0 and let GMT compute what height needs to be based on the -R -J but that is not yet known when gmt inset begin starts. Will need to think about this a bit. Feel free to turn this "lesson" into a feature request, for instance.
changed the title [-]Let inset adjust size for a given region and projection[/-][+]Let inset begin accept -R and -J to automatically set width or height[/+]on Oct 19, 2021
Activity
PaulWessel commentedon Oct 18, 2021
This is not a bug (it is a feature): The user is specifying a 2cx2c inset and requests a Mercator plot for some region. The dimension of that map is
so -JM? finds that it needs to use a width of 2 * (2/2.20926717722) to fit inside the box. Now, I understand this is inconvenient and perhaps we can improve this, but the solution would be to ask for +w2c/2.20926717722c:
I guess one possible way to deal with this is to specify +w2c/0 and let GMT compute what height needs to be based on the -R -J but that is not yet known when gmt inset begin starts. Will need to think about this a bit. Feel free to turn this "lesson" into a feature request, for instance.
maxrjones commentedon Oct 18, 2021
Could
inset beginaccept -J and -R similar tosubplot beginin order to make this easier for the user?[-]Inset size not correctly adjusted for region[/-][+]Let inset adjust size for a given region and projection[/+]PaulWessel commentedon Oct 18, 2021
[-]Let inset adjust size for a given region and projection[/-][+]Let inset begin accept -R and -J to automatically set width or height[/+]maxrjones commentedon Oct 19, 2021
OK, I have adjusted this issue to be a feature request rather than a bug report and detailed the suggested feature in the main post.
Let inset begin take -R -J to determine inset size
Let inset begin optionally take -R -J to determine inset size instead…
PaulWessel commentedon Nov 4, 2021
OK, to close this issue, @meghanrjones ?