You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Potential issues or breaking changes with the GMT modern theme? #4955
changed the title [-]Potential issues with the GMT modern theme?[/-][+]Potential issues / breaking changes with the GMT modern theme?[/+]on Mar 13, 2021
changed the title [-]Potential issues / breaking changes with the GMT modern theme?[/-][+]Potential issues or breaking changes with the GMT modern theme?[/+]on Mar 13, 2021
gmt basemap -R0/360/0/1 -JP5c -Baf -pdf map
basemap [NOTICE]: Given polar projection flip = 0, set MAP_FRAME_AXES = WrbNZ
gmt basemap -R0/90/0/1 -JP5c+a+t45 -Baf -pdf map
basemap [NOTICE]: Given polar projection flip = 0, set MAP_FRAME_AXES = WrbNZ
basemap [WARNING]: 2 annotations along the right border were skipped due to crowding.
basemap [WARNING]: Crowding decisions is controlled by MAP_ANNOT_MIN_SPACING, currently set to 23.0363p.
basemap [WARNING]: Decrease or increase MAP_ANNOT_MIN_SPACING to see more or fewer annotations, with 0 showing all annotations.
The colorbar issue is related to current.map.frame.draw in GMT being set to true inside gmt_set_undefined_axes. This is probably also the case with the first example (gmt basemap -R0/1/0/1 -JX5c -B+t"ABC" -png map). I am not sure how to solve this, however.
I am wondering if it is possible to use a gentler scaling for MAP_ANNOT_MIN_SPACING if a defined annotation spacing is given. For example, while the warnings are helpful for knowing the reason for the missing annotations, it seems a bit problematic to require setting MAP_ANNOT_MIN_SPACING for a command like this: gmt basemap -Rg -JV12c -Ba15fg -png map
or gmt coast -Rd -JN12c -Bxa15g -Bya30g -Dc -A10000 -Ggoldenrod -Ssnow2 -pdf GMT_robinson
All of the remaining issues are related to these new lines in gmt_auto_frame_interval. I'm doing some trial and error checks to see if there is a better multiplier here, because 1.75 is too large.
#ifndef NO_THEMES
if (GMT->current.setting.run_mode == GMT_MODERN && gmt_M_axis_is_geo (GMT, axis)) { /* Need more space for degree symbol and WESN letters not considered in the algorithm */
if (strchr (GMT->current.setting.format_geo_map, 'F')) /* Need more space for degree symbol and letter */
d *= 1.75;
else /* Just more space for degree symbol */
d *= 1.25;
}
#endif
The automatic annotation and frame intervals may not as good as v6.1.1.
gmt basemap -JM6c -R-125/-121/47/48 -B -png map
v6.1.1 master
In addition to only having one western annotation, these figures show that fancy frames in 6.1.1 did not have tick marks by default, but do have tick marks after the themes branch was merged. I think the old default (no tick marks on fancy frames) should be maintained. What do you think, @PaulWessel?
The tick marks were always there but drowned by that over-thick frame. So more of a mini-bug than feature in my mind. I think ticks should be shown as they are in modern. If anyone wants to maintain that "failure/feature" they can shrink their tick lengths to match the frame width.
The tick marks were always there but drowned by that over-thick frame. So more of a mini-bug than feature in my mind. I think ticks should be shown as they are in modern. If anyone wants to maintain that "failure/feature" they can shrink their tick lengths to match the frame width.
Thanks for the explanation. One more question regarding the maps from the last comment. gmt_auto_frame_intervals is called independently on the x- and y- axes. Then, the maximum interval from those calls is used both for the x- and y- axes. Can you explain the motivation for having the interval be identical on both axes? This causes some limitations for maps that span great longitudes but short latitudes or vice versa (e.g., the equidistant conic example: https://docs.generic-mapping-tools.org/6.1/cookbook/map-projections.html#equidistant-conic-projection-jd-jd).
Here is the example above if the auto-x and auto-y intervals are considered independently:
I do not know - I think that was what Remko's old Fortran code did. Perhaps the joint/separate could be decided based on the differences in range? E.g r = (east-west)/{north-south); if (r < 0) r = 1.r; if (r > 2) do separate else joint?
I do not know - I think that was what Remko's old Fortran code did. Perhaps the joint/separate could be decided based on the differences in range? E.g r = (east-west)/{north-south); if (r < 0) r = 1.r; if (r > 2) do separate else joint?
Yes, I agree. I will open a PR with that type of solution - just wanted to check whether there was a historical reason for the current implementation before making any changes.
I do not know - I think that was what Remko's old Fortran code did. Perhaps the joint/separate could be decided based on the differences in range? E.g r = (east-west)/{north-south); if (r < 0) r = 1.r; if (r > 2) do separate else joint?
It turns out that adding something like this creates more problems than it solves. I simply reduced the first guess at the annotation interval in #4991 instead, which had been increased by 1.75 times in the themes branch.
@PaulWessel, can you take a look at these examples to provide your opinion about whether the auto scaling for MAP_FRAME_PEN for inset boxes should be improved (motivated by GenericMappingTools/pygmt#1287)? I remember discussing the pen thickness for subplots, but cannot remember if there was any discussion about insets.
The inset may plot a basemap and it certainly should be controlled by a scaled-down MAP_FRAME_PEN. However, the default for +p is a different thing taht should not worry about scalings, so that default should probably be the original unscaled one of 1.5p of whatever. You can always override with +p. So this line in gmt_getpanel may need revision:
P->pen1 = GMT->current.setting.map_frame_pen; /* Heavier pen for main outline */
and instead be
gmt_getpen (GMT, "thicker,black", &P->pen1 );
I think you can go ahead and test that with a WIP PR.
The inset may plot a basemap and it certainly should be controlled by a scaled-down MAP_FRAME_PEN. However, the default for +p is a different thing taht should not worry about scalings, so that default should probably be the original unscaled one of 1.5p of whatever. You can always override with +p. So this line in gmt_getpanel may need revision:
P->pen1 = GMT->current.setting.map_frame_pen; /* Heavier pen for main outline */
and instead be
gmt_getpen (GMT, "thicker,black", &P->pen1 );
I think you can go ahead and test that with a WIP PR.
Activity
seisman commentedon Mar 13, 2021
Global maps using most projections all have the similar issue.
[-]Default axes in GMT modern theme?[/-][+]Potential issues with the GMT modern theme?[/+][-]Potential issues with the GMT modern theme?[/-][+]Potential issues / breaking changes with the GMT modern theme?[/+][-]Potential issues / breaking changes with the GMT modern theme?[/-][+]Potential issues or breaking changes with the GMT modern theme?[/+]seisman commentedon Mar 13, 2021
I know the east and north annotations and ticks are not plotted by default, but the color bar is not annotated, too.
seisman commentedon Mar 13, 2021
The automatic annotation and frame intervals may not as good as v6.1.1.
seisman commentedon Mar 13, 2021
This one is pretty bad:
seisman commentedon Mar 13, 2021
maxrjones commentedon Mar 13, 2021
I will look into the colorbar issue
maxrjones commentedon Mar 13, 2021
The colorbar issue is related to current.map.frame.draw in GMT being set to
trueinsidegmt_set_undefined_axes. This is probably also the case with the first example (gmt basemap -R0/1/0/1 -JX5c -B+t"ABC" -png map). I am not sure how to solve this, however.maxrjones commentedon Mar 13, 2021
Reopening because #4957 only addressed #4955 (comment) and #4955 (comment)
maxrjones commentedon Mar 14, 2021
I am wondering if it is possible to use a gentler scaling for MAP_ANNOT_MIN_SPACING if a defined annotation spacing is given. For example, while the warnings are helpful for knowing the reason for the missing annotations, it seems a bit problematic to require setting MAP_ANNOT_MIN_SPACING for a command like this:
gmt basemap -Rg -JV12c -Ba15fg -png mapor
gmt coast -Rd -JN12c -Bxa15g -Bya30g -Dc -A10000 -Ggoldenrod -Ssnow2 -pdf GMT_robinson3 remaining items
maxrjones commentedon Mar 18, 2021
All of the remaining issues are related to these new lines in
gmt_auto_frame_interval. I'm doing some trial and error checks to see if there is a better multiplier here, because 1.75 is too large.maxrjones commentedon Mar 18, 2021
In addition to only having one western annotation, these figures show that fancy frames in 6.1.1 did not have tick marks by default, but do have tick marks after the themes branch was merged. I think the old default (no tick marks on fancy frames) should be maintained. What do you think, @PaulWessel?
PaulWessel commentedon Mar 18, 2021
The tick marks were always there but drowned by that over-thick frame. So more of a mini-bug than feature in my mind. I think ticks should be shown as they are in modern. If anyone wants to maintain that "failure/feature" they can shrink their tick lengths to match the frame width.
maxrjones commentedon Mar 18, 2021
Thanks for the explanation. One more question regarding the maps from the last comment.
gmt_auto_frame_intervalsis called independently on the x- and y- axes. Then, the maximum interval from those calls is used both for the x- and y- axes. Can you explain the motivation for having the interval be identical on both axes? This causes some limitations for maps that span great longitudes but short latitudes or vice versa (e.g., the equidistant conic example: https://docs.generic-mapping-tools.org/6.1/cookbook/map-projections.html#equidistant-conic-projection-jd-jd).Here is the example above if the auto-x and auto-y intervals are considered independently:
PaulWessel commentedon Mar 18, 2021
I do not know - I think that was what Remko's old Fortran code did. Perhaps the joint/separate could be decided based on the differences in range? E.g r = (east-west)/{north-south); if (r < 0) r = 1.r; if (r > 2) do separate else joint?
maxrjones commentedon Mar 18, 2021
Yes, I agree. I will open a PR with that type of solution - just wanted to check whether there was a historical reason for the current implementation before making any changes.
maxrjones commentedon Mar 18, 2021
It turns out that adding something like this creates more problems than it solves. I simply reduced the first guess at the annotation interval in #4991 instead, which had been increased by 1.75 times in the themes branch.
maxrjones commentedon Mar 19, 2021
@seisman, I think these are all handled now. Please reopen or create a separate issue if you notice more.
maxrjones commentedon May 24, 2021
@PaulWessel, can you take a look at these examples to provide your opinion about whether the auto scaling for
MAP_FRAME_PENfor inset boxes should be improved (motivated by GenericMappingTools/pygmt#1287)? I remember discussing the pen thickness for subplots, but cannot remember if there was any discussion about insets.Example 1:
Example 2:
PaulWessel commentedon May 24, 2021
Just so I understand, the question here is if MAP_FRAME_PEN (which is used if there is no +ppen in -F) shall be
Is this what you are getting at?
maxrjones commentedon May 24, 2021
Yes, this is my question. It seems now it is shrunk down based on inset size.
PaulWessel commentedon May 24, 2021
The inset may plot a basemap and it certainly should be controlled by a scaled-down MAP_FRAME_PEN. However, the default for +p is a different thing taht should not worry about scalings, so that default should probably be the original unscaled one of 1.5p of whatever. You can always override with +p. So this line in gmt_getpanel may need revision:
and instead be
gmt_getpen (GMT, "thicker,black", &P->pen1 );I think you can go ahead and test that with a WIP PR.
maxrjones commentedon May 24, 2021
OK, I will work on this.