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
Colorbar positioning is problematic in subplot mode #2426
After adding verbose="d" to the Figure.colobar() call in the PyGMT script, I see debug messages like:
pygmt-session [DEBUG]: Use PS filename /Users/seisman/.gmt/sessions/gmt_session.6653/gmt_1.ps-
pygmt-session [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode
pygmt-session [DEBUG]: Modern mode: Added -R to options since history is available [0/3.93701/0/1.9685].
pygmt-session [DEBUG]: Modern: Adding -JX15c/15c to options since there is no history available.
pygmt-session [DEBUG]: Revised options: -B -Cturbo -DJBC+w5c+h -Vd -R -JX15c/15c
colorbar [DEBUG]: History: Process -R
colorbar [DEBUG]: History: Process -JX15c/15c
For comparison, adding -Vd to the colorbar command in the bash script gives:
gmt [DEBUG]: Use PS filename /Users/seisman/.gmt/sessions/gmt_session.6943/gmt_0.ps-
gmt [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode
gmt [DEBUG]: Modern mode: Added -R to options since history is available [0/3.93701/0/1.9685].
gmt [DEBUG]: Modern: Adding -J to options since history is available [x1i].
gmt [DEBUG]: Revised options: -DJBC+w5c+h -Cturbo -B -Vd -R -J
colorbar [DEBUG]: History: Process -R
colorbar [DEBUG]: History: Process -J
So, for unknown reasons, PyGMT fails to get the history information for -J option and use the default -JX15c/15c instead, which explains the incorrect positioning of colorbars.
Hm, got to be something different in the wrapper when it calls GMT compared to the CLI. I suggest you first do this
gmt clear sessions
Run each of the CLI commands and examine what is created in ~/.gmt/sessions/gmt_session.* Take a note of files being created and destroyed after each command
Repeat 1
Do the same on command at the time via PyGMT and compare to see what and when things go wrong.
Hm, got to be something different in the wrapper when it calls GMT compared to the CLI. I suggest you first do this
gmt clear sessions
Run each of the CLI commands and examine what is created in ~/.gmt/sessions/gmt_session.* Take a note of files being created and destroyed after each command
Repeat 1
Do the same on command at the time via PyGMT and compare to see what and when things go wrong.
Thanks. It helps me find the culprit. It's NOT a GMT bug. It's a bug on the PyGMT side.
Activity
seisman commentedon Mar 15, 2023
After adding
verbose="d"to theFigure.colobar()call in the PyGMT script, I see debug messages like:For comparison, adding
-Vdto thecolorbarcommand in the bash script gives:So, for unknown reasons, PyGMT fails to get the history information for
-Joption and use the default-JX15c/15cinstead, which explains the incorrect positioning of colorbars.seisman commentedon Mar 15, 2023
Ping @PaulWessel. Need your help here.
PaulWessel commentedon Mar 15, 2023
Hm, got to be something different in the wrapper when it calls GMT compared to the CLI. I suggest you first do this
seisman commentedon Mar 15, 2023
Thanks. It helps me find the culprit. It's NOT a GMT bug. It's a bug on the PyGMT side.
tiannh7 commentedon Sep 23, 2025
Hi @seisman @PaulWessel
I encountered a similar problem with subplot:subsize in current pygmt version:
seisman commentedon Sep 23, 2025
I can't reproduce your issue. Please provide a minimum working example.