Add new -B axis modifier +e to skip annotation(s) at end of an axis#5873
Merged
Add new -B axis modifier +e to skip annotation(s) at end of an axis#5873
Conversation
When composing multible frames or plots, expecially with y-annotations parallel to the axis, it is convenient to be able to skip plotting the annotations that land exactly at the end of an axis (or just one end). This is difficult todo in GMT without changing -R (say -R0/0.9999 instead of -R0/1) but that is not a satisfactory solution. The new axis modifier +e[l|h] will turn off both or just the lower or upper annotation if it lands at the end of the axis. I have added a simple test script to illustrate the effect and ensure it works.
Esteban82
approved these changes
Oct 18, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When composing multiple frames or plots in a figure, especially when requesting y-annotations parallel to the axis, it is convenient to be able to skip plotting the annotations that land exactly at the end of an axis (or just one end) so they do not stick outside the axis length. This is difficult to do in GMT without messing with -R (say -R0/9.9999 instead of -R0/10) but that is not a satisfactory solution and requires manual edits of scripts which may not work when programming them. In fact, I ran into this in preparing figures for a paper and needed to do this.
The new axis modifier +e[l|u] will turn off both or just the lower or upper annotation if it lands at the end of the axis (the threshold is the same we use for inside annotations, 1e-4 inches). I have added a simple test script to illustrate the effect and ensure it works:
This PR also does some maintenance in using new constants GMT_AXIS_MODIFIERS and GMT_FRAME_MODIFIERS to handle the list of modifiers instead of having the hard-wired in several places which invites future bugs (as we have done for other modifiers).