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
gmt basemap -Bs -Bxaf draws full frame with WS axes annotated #8827
gmt 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
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.
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
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:
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.
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.
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?
I don't see what we can do for the Bs ambiguity but the BsBs 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.
Activity
mkononets commentedon Nov 11, 2025
-Bsn -Bxafworks as expected:-Bw -Byafworks as expected:-Bwe -Byafworks as expected:joa-quim commentedon Nov 11, 2025
I think the issue here is
-Bsalone is being taken as meaning secondary axis, not south. The long tick make think it glued the primary and secondary axes ticks.mkononets commentedon 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 -Bxaor-Bs -Bxaf?gmt basemap -R0/1/0/1 -JX5c -Bs -Ba -png testproduces one axis with primary major ticks:gmt basemap -R0/1/0/1 -JX5c -Bs -Baf -png testproduces one axis with primary minor and major ticks as I wanted:While
gmt basemap -R0/1/0/1 -JX5c -Bs -Bxa -png testproduces warnings and a full frame with two annotated axes (secondary annotated ticks):mkononets commentedon Nov 11, 2025
Now, the below is probably a feature request:
For Cartesian axes
-Bsdisables both annotations and the Cartesian axis label no matter that the label was specified explicitly, while-BSplots 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 textThanks.
joa-quim commentedon Nov 11, 2025
gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -B -Byaf -png testThis a typo, no (the
-Balone)? Because I get a syntax error.Sorry, I'm not following. Can you give an example.
mkononets commentedon Nov 11, 2025
Sorry yes that was a typo,
-Bs, that one-liner should readgmt 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:
The gap between the label and the axis ticks is left for my custom external annotations.
joa-quim commentedon Nov 11, 2025
So, you wanted that (no need for the
-Byafsince you are restricting to south axis alone with the-BS)gmt basemap -R0/1/0/1 -JX5c -Bxaf+l"Distance, km" -BS -png testproduced your above example? That is to not do the automatic annotations in
-Bxapart? But that would be a breaking change. Or am I not getting it yet?joa-quim commentedon 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 testmkononets commentedon Nov 11, 2025
That's a very good workaround. Thanks!
joa-quim commentedon May 29, 2026
Can we close this or is there still something broken?
mkononets commentedon May 29, 2026
There's certain ambiguity in when
-Bsimplies 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 -Bsplots primary south axis alone (as I wanted with a single-Bsspecification)-Bs -Bsplots secondary south axis alone(while
-Bsalone plots the full frame with two secondary axes as I complained about i the topic):If you (or anybody else) has nothing more to add, this can be closed.
joa-quim commentedon May 29, 2026
I don't see what we can do for the
Bsambiguity but theBsBseffect 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.