Skip to content

Let inset begin accept -R and -J to automatically set width or height #5875

Closed

Description

@maxrjones

Description of the desired feature

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

expected output

Are you willing to help implement and maintain this feature? Yes

Activity

  1. added
    bug
    on Oct 18, 2021
  2. PaulWessel commented on Oct 18, 2021

    @PaulWessel
    Contributor

    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

    gmt mapproject -R-80/-28/-43/10 -JM2c -W
    2	2.20926717722
    

    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:

    test

    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.

  3. maxrjones commented on Oct 18, 2021

    @maxrjones
    MemberAuthor

    Could inset begin accept -J and -R similar to subplot begin in order to make this easier for the user?

  4. changed the title [-]Inset size not correctly adjusted for region[/-] [+]Let inset adjust size for a given region and projection[/+] on Oct 18, 2021
  5. added
    feature request
    and removed
    bug
    on Oct 18, 2021
  6. PaulWessel commented on Oct 18, 2021

    @PaulWessel
    Contributor
  7. 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
  8. maxrjones commented on Oct 19, 2021

    @maxrjones
    MemberAuthor

    Yes, possibly. Please make a feature request and include that suggestion.

    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.

  9. PaulWessel commented on Nov 4, 2021

    @PaulWessel
    Contributor

    OK, to close this issue, @meghanrjones ?

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

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions