Skip to content

Justification of map roses ignore space for label #6213

Closed

Description

@PaulWessel

We can place a directional rose anywhere on the map via -T, and most easily via justification codes for the 12 points on the map. However, if labels are requested then two issues are apparent:

  1. The default font used need to scale with the symbol and not be a fixed separate setting. Turns out this is FONT_TITLE which defaults to 24p,Helvetica,black. This is way too big for all but poster-size maps I think, so I am sure any users of -T also sets a smaller font that is suitable. In fact, our own example in the cookbook (GMT_obl_merc.sh) uses --FONT_TITLE=8p.
  2. The space needed for the labels needs to be considered in the justification so they are not falling outside the map

Here is the what is happening now:

roses

At least in modern mode that font should scale with the rose symbol size. For both classic and modern the offset should take into account the labels.

Activity

  1. added
    bug
    on Jan 11, 2022
  2. self-assigned this
    on Jan 11, 2022
  3. maxrjones commented on Mar 2, 2022

    @maxrjones
    Member

    One issue with the current positional adjustments is that the same offsets seem to apply regardless of whether the labels are actually plotted. Here is an example from the PyGMT tests:

    GMT main branch GMT 6.3.0
    new old
    gmt begin test png
        gmt basemap -R0/9/0/9 -JC3/3/9c -TmjTL+w4c+d4.5
        gmt basemap -TmjBR+w5c+d-4.5
    gmt end show
    
  4. seisman commented on Mar 6, 2022

    @seisman
    Member

    Maybe related to this issue:

    gmt basemap -R-10/10/-10/10 -JM15c -TdjMC+w5c -Bafg -png map
    

    The direction rose is not plotted at the middler center (MC) of the map:
    map

    In the following command, I mistyped +w5c as +5c:

    gmt basemap -R-10/10/-10/10 -JM15c -TdjMC+5c -Bafg -png map
    

    and I got the below figure. Perhaps GMT can do better at checking the syntax?
    map

  5. added this to the milestone on Mar 23, 2022
  6. seisman commented on Apr 25, 2022

    @seisman
    Member

    After PR #6215 was merged, here are what the rose placements look like using the following test script:

    gmt begin rose
    	gmt basemap -R-74/-69.5/41/43 -JM15c -Baf
    	for just in TL TC TR ML MC MR BL BC BR; do
    		gmt basemap -Tdj${just}+w1.5c
    	done
    gmt end show
    

    Plain roses without labels
    rose

    Plain roses with labels (adding modifier +l)
    rose

    Fancy roses without labels (adding modifier +f)
    rose

    Fancy roses with labels (adding modifier +f+l)
    rose

    @PaulWessel Because the changes in PR #6215 break a few PyGMT tests, could you please verify that the current placements of these roses are correct and the same as expected?

  7. seisman commented on Apr 25, 2022

    @seisman
    Member

    Similarly, please also verify the placements of magmatic roses (especially the offset between the rose and the frames) are correct:

    rose
    rose

  8. PaulWessel commented on Apr 26, 2022

    @PaulWessel
    ContributorAuthor

    I guess the only thing that might need a 2nd look is the unlabeled roses. But we can see the spacing is different (smaller) than the case with WESN labels. The question is should it be even smaller. I assume that is what you are wondering? I see the code computes the same initial offsets for either rose, but clearly there are things later that must add more.

    Let me know if this is the concern before I did into this.

  9. seisman commented on Apr 26, 2022

    @seisman
    Member

    The question is should it be even smaller. I assume that is what you are wondering?

    Yes, exactly. The spacing in PR #6626 looks better.

    Here is the new image after applying PR #6626.
    rose

  10. seisman commented on Apr 26, 2022

    @seisman
    Member

    Can we close the issue?

  11. PaulWessel commented on Apr 26, 2022

    @PaulWessel
    ContributorAuthor

    Yes, done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions