Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expected behavior of subplot frame annotations #4756

PaulWessel started this conversation in Code development discussion
Discussion options

Given we currently have some minor differences between the behavior in master and gmt-themes branch, I wanted to clarify what I think is the desired behavior before we hunt for bugs. Below is what I think was the intent (which may differ from current implementation).

There are four distinct cases depending on the use of -S:

1: No -S:

  • Each panel's frames are controlled by the MAP_FRAME_AXES setting
  • This can be overridden for all panels by adding -Bframeargs to the subplot begin command
  • It can further be overridden by adding -Bframeargs to the first plot command in a panel

2: Using -SC:

Each column of panels share the same xmin/xmax range and thus can share axes:

  • User chooses to annotate the top and bottom x-axes, or just the top (-SCt) or bottom (-SCb) axis will be annotated.
  • All other x-axes shall not be annotated and their presence and attributes as a non-annotated axis is under the control of MAP_FRAME_AXES.
  • That setting can be overridden by adding -Bframeargs to the to the subplot begin command
  • Because of layout settings dictated by -SC, -Bframeargs for panels is not considered.

3: Using -SR:

Each row of panels share the same ymin/ymax range and thus can share axes:

  • User chooses to annotate the leftmost and rightmost y-axes, or just the top (-SRl) or bottom (-SRr) axis will be annotated.
  • All other y-axis are not to annotated and their presence and attributes as a non-annotated axis is under the control of MAP_FRAME_AXES.
  • That setting can be overridden by adding -Bframeargs to the to the subplot begin command
  • Because of layout settings, -Bframeargs for panels is not considered.

**4: Using both -SC and -SR

For each of these cases I see four possible variations:

  1. Accept the default behavior
  2. Override MAP_FRAME_AXES on the gmt subplot begin command
  3. Override via -Bframe on the gmt subplot begin command
  4. Override via -Bframe for individual panels

This yields a total of 16 demonstrations of 2x2 subplot behaviors. I have grouped each subplot category so we can examine each case and its four variants. Note: In master, the default MAP_FRAME_AXES remains WESNZ at this writing so I modify that in the examples. I realize I am not testing lrbt vs wesn below but we will since modern mode has a WrStZ default. Note: The panel override is always for the lower left (LL) panel in all examples.

1: No -S: I think all variants are correct.

subplot_1

2: Using -SC: I think 2.0 is not correct. The three x-axes outside -SC annotation control should be drawn per WESN. 2.1 works for rows but one x-axis drawn missing (should be like 2.2). 2.3 panel OK but otherwise same issue as 2.0

subplot_2

3: Using -SR: Same problems as case 2 but transposed.

subplot_3

**4: Using both -SC and -SR CLoser, but 4.1 shows MAP_FRAME_AXES is not consulted. The rest looks OK

subplot_4

You must be logged in to vote

Replies: 4 comments 4 replies

Comment options

PaulWessel
Feb 6, 2021
Maintainer Author

I think I should add these scripts to our modern test suite (all passing for now until we make any changes). Pinging @GenericMappingTools/core and @GenericMappingTools/gmt-contributors to comment on this discussion item.

You must be logged in to vote
3 replies
Comment options

Does the behavior in 2.0 and 3.0 match your expectation if +w is appended? From reading the subplot -S documentation, my interpretation is that the plotted results are consistent with the documentation, specifically "Append +w to draw horizontal and vertical lines between interior panels using selected pen [no lines]".

Comment options

PaulWessel Feb 6, 2021
Maintainer Author

That +w goes with -F and was used above to draw the red lines for 2x2 subplots consisting of the PNGs from the 4 smaller 2x2 subplots. So it has nothing to do with -S.

Comment options

I understand and agree with your interpretation of the 'correct' behavior.

Comment options

PaulWessel
Feb 8, 2021
Maintainer Author

Do @joa-quim and @seisman agree with the above so that I can work on addressing the mistakes identified in master before we try to merge in gmt-themes?

You must be logged in to vote
1 reply
Comment options

I agree with what you said.

Comment options

Didn't follow them all, but go.

You must be logged in to vote
0 replies
Comment options

Just for the record, I was not accurate above. The MAP_FRAME_AXES default in master at this time is WESNZ. That means if -SC or -SR determine which axes should be annotated, the others should be relegated to the lower-case version of what MAP_FRAME_AXES says, i.e., wesn. Given that, these are the only one that passes: 1.x (all of the ones with no -S), x.2 (all LL panels are correct). The rest fail.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /