-
Notifications
You must be signed in to change notification settings - Fork 407
Expected behavior of subplot frame annotations #4756
-
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:
- Accept the default behavior
- Override MAP_FRAME_AXES on the gmt subplot begin command
- Override via -Bframe on the gmt subplot begin command
- 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.
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
3: Using -SR: Same problems as case 2 but transposed.
**4: Using both -SC and -SR CLoser, but 4.1 shows MAP_FRAME_AXES is not consulted. The rest looks OK
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments 4 replies
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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]".
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
I understand and agree with your interpretation of the 'correct' behavior.
Beta Was this translation helpful? Give feedback.
All reactions
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
I agree with what you said.
Beta Was this translation helpful? Give feedback.
All reactions
-
Didn't follow them all, but go.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.