GeezerVison is showing github.com — gmt basemap -Bs -Bxaf draws full frame with WS axes annotated · Issue #8827 · GenericMappingTools/gmt
gmt basemap -Bs -Bxaf draws full frame with WS axes annotated #8827Labels bugSomething isn't working Descriptiongmt basemap -Bs -Bxaf draws full frame with WS axes annotated instead of just one X axis with ticks and no annotations and no other axes. I believe this is likely a bug. Same with -Bx, -Bxa.
I wanted to plot an X axis with ticks but no annotations for adding annotations externally for a complex plot.
I call gmt basemap -R0/1/0/1 -JX5c -Bs -Bxaf -png test and get a full frame with WS axes annotated and funny unproportionally long ticks:
after some testing I've got the needed result by running gmt basemap -R0/1/0/1 -Jx5c -Bs -B -png test
 Activitymkononets commented on Nov 11, 2025 -Bsn -Bxaf works as expected:
-Bw -Byaf works as expected:
-Bwe -Byaf works as expected:
 joa-quim commented on Nov 11, 2025 I think the issue here is -Bs alone is being taken as meaning secondary axis, not south. The long tick make think it glued the primary and secondary axes ticks. mkononets commented on Nov 11, 2025 Thanks, that makes lot sense! Not a real bug then but the secondary axis config gets precedence.
Would probably be not bad to have this mentioned somewhere in the docs.
UPD Wait, why then a full frame gets plotted with two axes get annotated using -Bs -Bxa or -Bs -Bxaf?
gmt basemap -R0/1/0/1 -JX5c -Bs -Ba -png test produces one axis with primary major ticks:
gmt basemap -R0/1/0/1 -JX5c -Bs -Baf -png test produces one axis with primary minor and major ticks as I wanted:
While gmt basemap -R0/1/0/1 -JX5c -Bs -Bxa -png test produces warnings and a full frame with two annotated axes (secondary annotated ticks):
basemap [WARNING]: Your primary x tick interval exceeds the secondary interval.
basemap [WARNING]: GMT expects it to be the other way around (primary annotations are closest to axis, secondary are further away)
basemap [WARNING]: Consider correcting your command - proceeding with your selections
basemap [WARNING]: Your primary x tick interval exceeds the secondary interval.
basemap [WARNING]: GMT expects it to be the other way around (primary annotations are closest to axis, secondary are further away)
basemap [WARNING]: Consider correcting your command - proceeding with your selections
basemap [WARNING]: Your primary x tick interval exceeds the secondary interval.
basemap [WARNING]: GMT expects it to be the other way around (primary annotations are closest to axis, secondary are further away)
basemap [WARNING]: Consider correcting your command - proceeding with your selections
 mkononets commented on Nov 11, 2025 Now, the below is probably a feature request:
For Cartesian axes -Bs disables both annotations and the Cartesian axis label no matter that the label was specified explicitly, while -BS plots both the annotations and the label (if specified):
gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -Bs -Byaf -png test:
gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -BS -Byaf -png test:
Is it possible to enable plotting the Cartesian axis label if it is explicitly specified regardless of the annotation configuration? This is for adding custom annotations externally using gmt text
Thanks. joa-quim commented on Nov 11, 2025 gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -B -Byaf -png test
This a typo, no (the -B alone)? Because I get a syntax error.
Is it possible to enable plotting the Cartesian axis label if it is explicitly specified regardless of the annotation configuration?
Sorry, I'm not following. Can you give an example. mkononets commented on Nov 11, 2025 Sorry yes that was a typo, -Bs, that one-liner should read gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -Bs -Byaf -png test. Corrected also above.
The on-liner was supposed to produce the below:
gmt begin test_xlabel_noannot png
gmt basemap -R0/1/0/1 -JX5c -Bxaf -Bs -Byaf
gmt text -F+f12p,Helvetica+jMC+cBC+t"Distance, km" -D0p/-20p -N
gmt end show
The gap between the label and the axis ticks is left for my custom external annotations. joa-quim commented on Nov 11, 2025 So, you wanted that (no need for the -Byaf since you are restricting to south axis alone with the -BS)
gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -BS -png test
produced your above example? That is to not do the automatic annotations in -Bxa part? But that would be a breaking change. Or am I not getting it yet? joa-quim commented on Nov 11, 2025 You can't remove them, but you can make them transparent.
gmt basemap -R0/1/0/1 -JX5c -Baf+l"Distance, km" -BS --FONT_ANNOT_PRIMARY=10@100 -png test
 mkononets commented on Nov 11, 2025 That's a very good workaround. Thanks! joa-quim commented on May 29, 2026 Can we close this or is there still something broken? mkononets commented on May 29, 2026 There's certain ambiguity in when -Bs implies a primary south axis alone and when a secondary axis.
Is it a bug? Most likely not.
Is is a documentation issue? Probably yes, but I have no idea how to fix it best. Axis specs can be very complex.
Two more one-liners to make this example a bit more documented:
-Bp -Bs plots primary south axis alone (as I wanted with a single -Bs specification)
-Bs -Bs plots secondary south axis alone
(while -Bs alone plots the full frame with two secondary axes as I complained about i the topic):
gmt basemap -R0/1/0/1 -JX5c -Bp -Bs -Bxaf -png test-Bp-Bs-Bxaf
gmt basemap -R0/1/0/1 -JX5c -Bs -Bs -Bxaf -png test-Bs-Bs-Bxaf
| test-Bp-Bs-Bxaf.png | test-Bs-Bs-Bxaf.png |
|
|
If you (or anybody else) has nothing more to add, this can be closed. joa-quim commented on May 29, 2026 I don't see what we can do for the Bs ambiguity but the Bs Bs effect on the ticks length is highly annoying, though I don't even know what to expect as the right thing to do and whatever, it will likely be a considerable amount of work. So, we probably better close this.
MetadataMetadatabugSomething isn't working DevelopmentNo branches or pull requestsIssue actions
|