Repository navigation
Closed
Labels
bugSomething isn't working
Description
gmt basemap -R... -J... -A works in a multi-call modern mode session, works as a classic mode call but fails as a modern mode one-liner with weird error messages, see below. Tried with gmt version 6.6.0.
from the docs:
-A[file]
No plotting is performed. Instead, we determine the geographical coordinates of
the polygon outline for the (possibly oblique) rectangular map domain. The plot domain
must be given via [-R](https://docs.generic-mapping-tools.org/dev/basemap.html#r) and
[-J](https://docs.generic-mapping-tools.org/dev/basemap.html#j), with no other options
allowed. The sampling interval is controlled via [MAP_LINE_STEP](https://docs.generic-mapping-tools.org/dev/gmt.conf.html#term-MAP_LINE_STEP)
parameter. The coordinates are written to file or to standard output if no file is specified.
gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt fails with the following error message with and without out.txt requested after -A:
gmt [ERROR]: Shared GMT module not found: basemap
ERROR: No module named basemap was found. This could mean one of four cases:
1. There actually is no such module; please check your spelling.
2. You used a modern mode module name while running in GMT classic mode.
3. Module exists in the GMT supplemental library, but the library could not be found.
4. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.
gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt -png quick also fails:
psbasemap [ERROR]: Option -p (ng): Syntax is -p[x|y|z]<azim>[/<elev>[/<zlevel>]][+w<lon0>/<lat0>[/<z0>]][+v<x0>/<y0>]
psbasemap [ERROR]: Option -p parsing failure. Correct syntax:
-p[x|y|z]<azim>[/<elev>[/<zlevel>]][+w<lon0>/<lat0>[/<z0>]][+v<x0>/<y0>]
Select a 3-D pseudo perspective view. Append the <azimuth>/<elevation> of
the viewpoint [180/90], and when used with -Jz|Z, optionally add /<zlevel>
for basemap level [bottom of z-axis]. Prepend x or y to plot against the
"wall" x = level or y = level [z]. For a plain rotation about the z-
axis, give rotation angle only and optionally use modifiers +w or +v to
select location of axis:
+w Specify a fixed coordinate point [region center].
+v Set a fixed projected point [panel center].
psbasemap [ERROR]: Offending option -png
gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt -png quick -B terminates w/o errors but produces neither the -A output nor the plot.
A classic mode call gmt psbasemap -JS0/-90/20c -R3000+uk -A produces the desired output.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Esteban82 commentedon Apr 6, 2026
I tested this and can confirm that it fails, but I’m not sure this should be considered a bug.
The one-liner syntax is meant for commands that produce a figure, while
basemap -Aexplicitly performs no plotting. Also, a valid one-liner requires the-format prefixoption, which is missing here—and would not make sense to add in this case.So this seems consistent with the documented behavior rather than a bug.
joa-quim commentedon Apr 6, 2026
Agree, and for that reason I guess we could find more cases involving other modules showing the same behavior.
mkononets commentedon Apr 6, 2026
In case my long and detailed report was not really clear:
The documented behavior is literally this:
When I call
gmt basemap -JS0/-90/20c -R3000+uk -Aout.txtoutside session the output file promised by the docs is not created. Instead the following error message is displayed:The expected result is not the above message, but the
out.txtfile with the coordinates.Not sure how to interpret this. Is it supposed to be like that?
joa-quim commentedon Apr 6, 2026
The modern mode is the result of a group epiphany while looking at the beautiful La Jolla Bay from a room in Scripts. The intent was to relieve newbies from learning the
-K -Odance. Latter, dropping the need for at least-R, -J, -Bwas added too. And even latter, mostly from pressure from me, Paul added theone-liners. But all of this add in mind figure producing commands, not the data processing ones. What you found is a side effect of a plot creating command, which has a little back-door that creates data. Is it a bug because it printsERROR: No module named basemap was found.? Maybe, but using data processing commands with modern mode was never the idea behind it.mkononets commentedon Apr 6, 2026
Oh yes I remember being that newbie learning gmt version 4: one
-K -Otypo somewhere in the middle of a long plotting script and the resulting.pscould not have been viewed.That
-K -Othing is definitely not good for people manually writing scripts and reusing old pieces of code by copy-pasting.basemap: Fix -A in modern mode.
basemap: Fix -A in modern mode. (GenericMappingTools#8980)