Skip to content

-X/-Y other than default relative are broken ? #6291

Closed

Description

@gd-a
gmt begin test png                 
    gmt basemap -JX10c -R0/1/0/1 -B+gblack
    gmt basemap -JX5c -R0/1/0/1 -B+ggreen -X10c -Y10c
    gmt basemap -JX5c -R0/1/0/1 -B+gred -Xa10c -Ya5c 
    gmt basemap -JX5c -R0/1/0/1 -B+gblue -Xf5c -Yf10c
    # gmt basemap -JX3c -R0/1/0/1 -Bafg -Xc -Yc # << this one is out of control !
gmt end show

test

Activity

  1. added
    bug
    on Feb 1, 2022
  2. gd-a commented on Feb 2, 2022

    @gd-a
    ContributorAuthor

    Also -X isn't relative to last -Xa call

  3. gd-a commented on Feb 3, 2022

    @gd-a
    ContributorAuthor

    ^ also messes up the automatic legend entry (-l) position

  4. PaulWessel commented on Feb 4, 2022

    @PaulWessel
    Contributor

    Before looking in detail the default answer is:

    1. I think -Xc -Yc was only intended to be used once with the first command
    2. We recommend either using -Xa -Ya for everything or doing everything relative -X -Y or -Xr -Yr
    3. I have personally never used -Xf -Yf and cannot find any code that checks for 'f'
  5. PaulWessel commented on Feb 4, 2022

    @PaulWessel
    Contributor

    Maybe @remkos remembers anything about -Xf -Yf? Or perhaps this was Florian's invention. I think bottom line is that there is nothing in the code that checks for 'f' and in fact if I run the example above I do not get that plot...

  6. gd-a commented on Feb 4, 2022

    @gd-a
    ContributorAuthor

    I think -Xc -Yc was only intended to be used once with the first command

    But everything is relative to the first command... and the first command is always centred ...

    We recommend either using -Xa -Ya for everything or doing everything relative -X -Y or -Xr -Yr

    For complex plots, -Xa is easier to deal with (cf the plot on the forum), but it is almost impossible to do without -X(r):

    • Automatic legend uses it
    • Every command using -D (inset...) uses it as a shortcut ... It is always possible to manually position it too with -Dx but the code gets unnecessarily heavy (IMO)
    • more concerning, following plots don't respect the previous -Xa positioning, forcing repetition every line.
    gmt begin test png
    gmt basemap -R0/1/0/1 -JX10c -Bafg
    gmt basemap -B+gred -Xa11c -Ya11c
    gmt basemap -B+gblue
    gmt end show
    

    and in fact if I run the example above I do not get that plot...

    O.O Me neither !
    I just reinstalled the latest version and the plot indeed changed, but for the worst. Now the blue square is even further south east. Nevertheless it doesn't work as it should ("as I think it should" should I say)

    bottom line is that there is nothing in the code that checks for 'f'

    In fact, now 'f' and 'c' behave in a similar way (making very veeeeeerrrrryyyy stretched plots)

    test

  7. remkos commented on Mar 15, 2022

    @remkos
    Contributor

    Maybe @remkos remembers anything about -Xf -Yf? Or perhaps this was Florian's invention. I think bottom line is that there is nothing in the code that checks for 'f' and in fact if I run the example above I do not get that plot...

    It was indeed me you introduced it in GMT5 on 14 Jun 2011. Maybe some of the code got broken since. I will check.

  8. remkos commented on Mar 15, 2022

    @remkos
    Contributor

    I have the strong feeling that the code to handle the 'f' case was removed when the code that did this in gmt_plot.c was ported to subplot.c where this seems to be handled now.
    So it is best that it is restored there by those who wrote subplot.c

  9. gd-a commented on Mar 8, 2023

    @gd-a
    ContributorAuthor

    Now hidden under classic mode :)

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions