Skip to content

Add new -B axis modifier +e to skip annotation(s) at end of an axis#5873

Merged
Esteban82 merged 3 commits intomasterfrom
axis-annot-skip-modifier
Oct 18, 2021
Merged

Add new -B axis modifier +e to skip annotation(s) at end of an axis#5873
Esteban82 merged 3 commits intomasterfrom
axis-annot-skip-modifier

Conversation

@PaulWessel
Copy link
Member

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:

skipannots

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).

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.
@PaulWessel PaulWessel added the new feature PR that implements a new feature or capability in GMT label Oct 17, 2021
@PaulWessel PaulWessel self-assigned this Oct 17, 2021
@Esteban82 Esteban82 merged commit f80596d into master Oct 18, 2021
@Esteban82 Esteban82 deleted the axis-annot-skip-modifier branch October 18, 2021 12:08
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog new feature PR that implements a new feature or capability in GMT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants