Skip to content

pygmt.config() does not apply FONT_ANNOT_PRIMARY when called before Figure() on PyGMT 0.18.0 / GMT 6.6.0 #4732

Open

Description

@jpatiani

Description of the problem

Description

I found an unexpected behavior of pygmt.config() when changing GMT font settings.

The configuration works if pygmt.config() is called after creating a Figure, but it is ignored if called before Figure().

This behavior differs from what I expected and from GMT command-line behavior.


Environment

PyGMT v0.18.0
GMT 6.6.0

Python 3.14.3
macOS 26.5.1 (Apple Silicon)

PyGMT information:
  version: v0.18.0

GMT library information:
  version: 6.6.0

Reproducible example

Case 1 (configuration ignored)

import pygmt

with pygmt.config(FONT_ANNOT_PRIMARY="32p,Courier,blue"):
    fig = pygmt.Figure()

    fig.basemap(
        region=[0,1,0,1],
        projection="X10c",
        frame="af",
    )

    fig.show()

Result:

  • annotation color remains black
  • annotation font remains default

Case 2 (works)

import pygmt

fig = pygmt.Figure()

with pygmt.config(FONT_ANNOT_PRIMARY="32p,Courier,blue"):

    fig.basemap(
        region=[0,1,0,1],
        projection="X10c",
        frame="af",
    )

    fig.show()

Result:

  • annotation becomes blue
  • font changes correctly

Verification

Inside the first example,

with pygmt.config(FONT_ANNOT_PRIMARY="32p,Courier,blue"):
    import subprocess
    subprocess.run(["gmt", "get", "FONT_ANNOT_PRIMARY"])

prints

32p,Courier,blue

so the configuration appears to be set.


GMT command line

The equivalent GMT command works correctly.

gmt begin test pdf
gmt set FONT_ANNOT_PRIMARY 32p,Courier,blue
gmt basemap -R0/1/0/1 -JX10c -Baf
gmt end show

The annotations are blue as expected.


Expected behavior

I expected both examples to produce identical figures because
pygmt.config() should configure the GMT session regardless of whether
Figure() has already been created.


Actual behavior

The configuration only takes effect if Figure() is created before entering the pygmt.config() context.


Question

Is this intended behavior due to how GMT modern-mode sessions are initialized, or is this a PyGMT bug?

Minimal Complete Verifiable Example

Full error message

System information

❯ python -c "import pygmt; pygmt.show_versions()"
PyGMT information:
  version: v0.18.0
System information:
  python: 3.14.3 (v3.14.3:323c59a5e34, Feb  3 2026, 11:41:37) [Clang 16.0.0 (clang-1600.0.26.6)]
  executable: /usr/local/bin/python
  machine: macOS-26.5.1-arm64-arm-64bit-Mach-O
Dependency information:
  numpy: 2.2.6
  pandas: 2.3.3
  xarray: 2025.7.1
  packaging: 26.0
  contextily: 1.7.0
  geopandas: 1.1.2
  IPython: 9.10.0
  pyarrow: 23.0.1
  rioxarray: 0.21.0
  gdal: 3.13.0
  ghostscript: 10.07.0
GMT library information:
  version: 6.6.0
  padding: 2
  share dir: /usr/local/Cellar/gmt-6.6.0/share
  plugin dir: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
  library path: /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
  cores: 8
  grid layout: rows
  image layout:
  binary version: 6.6.0

Activity

  1. added
    bug
    on Jul 17, 2026
  2. github-actions commented on Jul 17, 2026

    @github-actions
    Contributor

    👋 Thanks for opening your first issue here!

    Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

  3. seisman commented on Jul 17, 2026

    @seisman
    Member

    Hmmm, I can't reproduce your case 1, i.e., the annotation color and font work as expected for me.

    Could you please add pygmt.config(GMT_VERBOSE="debug") after import pygmt (for both cases 1 and 2), and then post the debugging messages?

  4. jpatiani commented on Jul 17, 2026

    @jpatiani
    Author

    Ok, that weird. Now, cases 1 and 2 give correct result. However, if I try with more complex command the behavior similar as the bug.

    Here with, I copy the code with debug report.

    Case 1

    with pygmt.config(FONT_LABEL="18p,Courier-Bold,red",FONT_ANNOT_PRIMARY="18p,Courier,blue"):
        fig  = pygmt.Figure()
        fig.basemap(region=[0, 21000, 0, 42], projection="X10c/15c", frame=["WS", "xafg+lHeight (m)", "yaf+lModel level"])
        fig.plot(x=z[:,j,i].values,y=range(z.shape[0]),pen="2p,black")
        fig.plot(x=z[:,j,i].values,y=range(z.shape[0]),style="c0.2c")
        fig.show()

    Debug result:

    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 3 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: Entering GMT_Destroy_Session
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 3 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 3 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt gmtset FONT_LABEL=18p,Courier-Bold,red FONT_ANNOT_PRIMARY=18p,Courier,blue
    pygmt-session [DEBUG]: Revised options: FONT_LABEL=18p,Courier-Bold,red FONT_ANNOT_PRIMARY=18p,Courier,blue
    gmtset [DEBUG]: gmtlib_get_graphics_item: Fig: 3 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 3 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt figure 72f84184a89b4825aea84f01800cf2bb -
    pygmt-session [DEBUG]: Revised options: 72f84184a89b4825aea84f01800cf2bb -
    figure [DEBUG]: New figure: 4   72f84184a89b4825aea84f01800cf2bb        -
    

    Case 2

    fig = pygmt.Figure()
    with pygmt.config(FONT_LABEL="18p,CourierBold,red",FONT_ANNOT_PRIMARY="18p,Courier,blue",GMT_VERBOSE="debug"):
        fig.basemap(region=[0, 21000, 0, 42], projection="X10c/15c", frame=["WS", "xafg+lHeight (m)", "yaf+lModel level"])
        fig.plot(x=z[:,j,i].values,y=range(z.shape[0]),pen="2p,black")
        fig.plot(x=z[:,j,i].values,y=range(z.shape[0]),style="c0.2c")
        fig.show()

    Debug result:

    gmtset [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt figure c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Revised options: c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt basemap -BWS -Bxafg+lHeight (m) -Byaf+lModel level -JX10c/15c -R0/21000/0/42
    pygmt-session [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    pygmt-session [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode
    pygmt-session [DEBUG]: Revised options: -BWS -B"xafg+lHeight (m)" -B"yaf+lModel level" -JX10c/15c -R0/21000/0/42
    basemap [DEBUG]: History: Process -JX10c/15c
    basemap [DEBUG]: History: Process -R0/21000/0/42
    basemap [INFORMATION]: GMT_Parse_Options: Interval-setting -B options were reordered to appear before axis and frame -B options to ensure proper parsing.
    basemap [INFORMATION]: GMT_Parse_Options: New option order: -JX10c/15c -R0/21000/0/42 -B"xafg+lHeight (m)" -B"yaf+lModel level" -BWS
    basemap [DEBUG]: Got regular w/e/s/n for region (0/21000/0/42)
    basemap [INFORMATION]: Constructing the basemap
    basemap [DEBUG]: Reset MAP_ANNOT_OBLIQUE to anywhere
    basemap [DEBUG]: Projected values in meters: 0 21000 0 42
    basemap [INFORMATION]: Linear projection implies y-axis distance exaggeration relative to the x-axis by a factor of 750
    basemap [DEBUG]: Computed automatic parameters using dimension scaling: 0.929966
    basemap [DEBUG]: Auto-frame interval for axis 0 item 0: d = 5000  f = 1000
    basemap [INFORMATION]: Auto-frame interval for x-axis (item 0): a5000f1000g5000
    basemap [DEBUG]: Auto-frame interval for axis 1 item 0: d = 10  f = 2
    basemap [INFORMATION]: Auto-frame interval for y-axis (item 0): a10f2
    basemap [INFORMATION]: Map scale is 2.1 km per cm or 1:210000.
    basemap [DEBUG]: Running in PS mode modern
    basemap [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    basemap [DEBUG]: Create hidden PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    basemap [DEBUG]: Got session name as pygmt-session and default graphics formats as pdf
    basemap [DEBUG]: Basemap order: Frame = below  Grid = below  Tick/Annot = below
    basemap [DEBUG]: Entering gmtplot_map_gridlines
    basemap [INFORMATION]: Save current gridline information to gmt.history
    basemap [DEBUG]: Draw x = 0 from 0 to 42
    basemap [DEBUG]: Draw x = 5000 from 0 to 42
    basemap [DEBUG]: Draw x = 10000 from 0 to 42
    basemap [DEBUG]: Draw x = 15000 from 0 to 42
    basemap [DEBUG]: Draw x = 20000 from 0 to 42
    basemap [DEBUG]: Exiting gmtplot_map_gridlines
    basemap [DEBUG]: Current size of half-baked PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps- = 23852.
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt figure c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Revised options: c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: Pad argument (2) ignored in initialization of Data Table
    pygmt-session [DEBUG]: Initializing a vector for handing external Input
    pygmt-session [DEBUG]: Object ID 0 : Registered Vector Memory Reference bec20f700 as an Input resource with geometry Point [n_objects = 1]
    pygmt-session [DEBUG]: Successfully created a new Vector container to represent a Data Table
    pygmt-session [INFORMATION]: GMT_Open_VirtualFile: Switch method to GMT_IS_DUPLICATE as input vectors are not compatible with a GMT dataset
    pygmt-session [DEBUG]: VirtualFile name created: @GMTAPI@-S-I-D-V-T-N-000000
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt plot @GMTAPI@-S-I-D-V-T-N-000000 -W2p,black
    pygmt-session [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.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/21000/0/42].
    pygmt-session [DEBUG]: Modern: Adding -J to options since history is available [X10c/15c].
    pygmt-session [DEBUG]: Revised options: @GMTAPI@-S-I-D-V-T-N-000000 -W2p,black -R -J
    plot [DEBUG]: History: Process -R
    plot [DEBUG]: History: Process -J
    plot [DEBUG]: Got regular w/e/s/n for region (0/21000/0/42)
    plot [INFORMATION]: Processing input table data
    plot [DEBUG]: Operation will require 2 input columns [n_cols_start = 2]
    plot [DEBUG]: Reset MAP_ANNOT_OBLIQUE to anywhere
    plot [DEBUG]: Projected values in meters: 0 21000 0 42
    plot [INFORMATION]: Linear projection implies y-axis distance exaggeration relative to the x-axis by a factor of 750
    plot [DEBUG]: Computed automatic parameters using dimension scaling: 0.929966
    plot [INFORMATION]: Map scale is 2.1 km per cm or 1:210000.
    plot [DEBUG]: Running in PS mode modern
    plot [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    plot [DEBUG]: Append to hidden PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    plot [DEBUG]: Got session name as pygmt-session and default graphics formats as pdf
    plot [DEBUG]: Basemap order: Frame = above  Grid = below  Tick/Annot = below
    plot [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Line
    plot [DEBUG]: gmtapi_init_import: Added 1 new sources
    plot [DEBUG]: GMT_Init_IO: Returned first Input object ID = 0
    plot [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
    plot [DEBUG]: gmtapi_import_dataset: Passed ID = -1 and mode = 0
    plot [INFORMATION]: Duplicating data table from user 2 column arrays of length 41
    plot [DEBUG]: Object ID 1 : Registered Data Table Memory Copy beb9d1c20 as an Input resource with geometry Point [n_objects = 2]
    plot [DEBUG]: gmtapi_import_dataset processed 1 resources
    plot [DEBUG]: GMT_End_IO: Input resource access is now disabled
    plot [INFORMATION]: Plotting segment 0
    plot [DEBUG]: GMT_Destroy_Data: freed memory for a Data Table for object 1
    plot [DEBUG]: gmtlib_unregister_io: Unregistering object no 1 [n_objects = 1]
    plot [DEBUG]: gmtlib_unregister_io: Object no 1 has non-NULL resource pointer
    plot [DEBUG]: Current size of half-baked PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps- = 24568.
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt figure c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Revised options: c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: Pad argument (2) ignored in initialization of Data Table
    pygmt-session [DEBUG]: Initializing a vector for handing external Input
    pygmt-session [DEBUG]: Object ID 0 : Registered Vector Memory Reference bec20f700 as an Input resource with geometry Point [n_objects = 1]
    pygmt-session [DEBUG]: Successfully created a new Vector container to represent a Data Table
    pygmt-session [INFORMATION]: GMT_Open_VirtualFile: Switch method to GMT_IS_DUPLICATE as input vectors are not compatible with a GMT dataset
    pygmt-session [DEBUG]: VirtualFile name created: @GMTAPI@-S-I-D-V-T-N-000000
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt plot @GMTAPI@-S-I-D-V-T-N-000000 -Sc0.2c
    pygmt-session [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.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/21000/0/42].
    pygmt-session [DEBUG]: Modern: Adding -J to options since history is available [X10c/15c].
    pygmt-session [DEBUG]: Revised options: @GMTAPI@-S-I-D-V-T-N-000000 -Sc0.2c -R -J
    plot [DEBUG]: History: Process -R
    plot [DEBUG]: History: Process -J
    plot [DEBUG]: Got regular w/e/s/n for region (0/21000/0/42)
    plot [INFORMATION]: Processing input table data
    plot [DEBUG]: Operation will require 2 input columns [n_cols_start = 2]
    plot [DEBUG]: Reset MAP_ANNOT_OBLIQUE to anywhere
    plot [DEBUG]: Projected values in meters: 0 21000 0 42
    plot [INFORMATION]: Linear projection implies y-axis distance exaggeration relative to the x-axis by a factor of 750
    plot [DEBUG]: Computed automatic parameters using dimension scaling: 0.929966
    plot [INFORMATION]: Map scale is 2.1 km per cm or 1:210000.
    plot [DEBUG]: Running in PS mode modern
    plot [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    plot [DEBUG]: Append to hidden PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    plot [DEBUG]: Got session name as pygmt-session and default graphics formats as pdf
    plot [DEBUG]: Basemap order: Frame = above  Grid = below  Tick/Annot = below
    plot [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Point
    plot [DEBUG]: gmtapi_init_import: Added 1 new sources
    plot [DEBUG]: GMT_Init_IO: Returned first Input object ID = 0
    plot [DEBUG]: GMT_Begin_IO: Mode value 1 not considered (ignored)
    plot [DEBUG]: GMT_Begin_IO: Initialize record-by-record access for Input
    plot [DEBUG]: gmtapi_next_io_source: Selected object 0
    plot [INFORMATION]: Reading Data Table from Input memory location via vector
    plot [DEBUG]: GMT_Begin_IO: Input resource access is now enabled [record-by-record]
    plot [DEBUG]: GMT_End_IO: Input resource access is now disabled
    plot [DEBUG]: Current size of half-baked PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps- = 25591.
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt figure c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Revised options: c2fd983391884517a9c75be7b50d4dc7 -
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt psconvert -A -E300 -F/var/folders/_4/ly31qk1934s924zy4n94zj7h0000gn/T/c2fd983391884517a9c75be7b50d4dc7-preview-5cyzfvob/c2fd983391884517a9c75be7b50d4dc7 -Tf
    pygmt-session [DEBUG]: Revised options: -A -E300 -F/var/folders/_4/ly31qk1934s924zy4n94zj7h0000gn/T/c2fd983391884517a9c75be7b50d4dc7-preview-5cyzfvob/c2fd983391884517a9c75be7b50d4dc7 -Tf
    psconvert [DEBUG]: Ghostscript executable full name:
    psconvert [DEBUG]: gmt_run_process_get_first_line: Pass to popen: [gs --version 2> /dev/null]
    psconvert [DEBUG]: gs --version 2> /dev/null was successful
    psconvert [DEBUG]: Ghostscript version: 10.07.0
    psconvert [DEBUG]: Use PS filename /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    psconvert [DEBUG]: Hidden PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps- found
    psconvert [DEBUG]: Complete partial PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    psconvert [DEBUG]: Size of half-baked PS file = 25591.
    psconvert [DEBUG]: Fattened up PS file /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-
    psconvert [INFORMATION]: Processing /Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-...
    psconvert [INFORMATION]: Find HiResBoundingBox ...
    psconvert [DEBUG]: Running: gs -q -dNOSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -DPSL_no_pagefill -dMaxBitmap=2147483647 -dUseFastColor=true '/Users/jpatiani/.gmt/sessions/gmt_session.7096/gmt_7.ps-' 2> '/Users/jpatiani/.gmt/sessions/gmt_session.7096/psconvert_7096c.bb'
    psconvert [INFORMATION]: Figure dimensions: Width: 339.534 points [11.978 cm]  Height: 462.988 points [16.3332 cm]
    psconvert [DEBUG]: Delete /Users/jpatiani/.gmt/sessions/gmt_session.7096/psconvert_7096c.bb
    psconvert [INFORMATION]: [2835.49 2843.21 3175.02 3306.2]...
    psconvert [INFORMATION]: Convert to PDF...
    psconvert [DEBUG]: Running: gs -q -dNOPAUSE -dBATCH -dNOSAFER -dPDFSETTINGS=/prepress -dDownsampleColorImages=false -dDownsampleGrayImages=false -dDownsampleMonoImages=false -dUseFlateCompression=true -dEmbedAllFonts=true -dSubsetFonts=true -dMonoImageFilter=/FlateEncode -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dSCANCONVERTERTYPE=2 -dALLOWPSTRANSPARENCY -dMaxBitmap=2147483647 -dUseFastColor=true -sDEVICE=pdfwrite  -g1415x1930 -r300 -sOutputFile='/var/folders/_4/ly31qk1934s924zy4n94zj7h0000gn/T/c2fd983391884517a9c75be7b50d4dc7-preview-5cyzfvob/c2fd983391884517a9c75be7b50d4dc7.pdf' '/Users/jpatiani/.gmt/sessions/gmt_session.7096/psconvert_7096d.eps'
    psconvert [DEBUG]: Delete /Users/jpatiani/.gmt/sessions/gmt_session.7096/psconvert_7096d.eps
    psconvert [DEBUG]: Final input buffer length was 128
    pygmt-session [DEBUG]: Exit:  gmt_reload_settings
    pygmt-session [DEBUG]: Enter: gmtlib_plot_C_format
    pygmt-session [DEBUG]: Exit:  gmtlib_plot_C_format
    pygmt-session [DEBUG]: Enter: gmtinit_get_history
    pygmt-session [DEBUG]: gmtlib_get_graphics_item: Fig: 7 Subplot: 2 Panel: () Inset: 0
    pygmt-session [DEBUG]: Enter: gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmt_hash_init
    pygmt-session [DEBUG]: Exit:  gmtinit_get_history
    pygmt-session [DEBUG]: Initialize FFTW with 8 threads.
    pygmt-session [DEBUG]: GMT_Create_Session initialized GMT structure
    pygmt-session [DEBUG]: Shared Library # 0 (core). Path = /usr/local/Cellar/gmt-6.6.0/lib/libgmt.dylib
    pygmt-session [DEBUG]: Loading GMT plugins from: /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins
    pygmt-session [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/Cellar/gmt-6.6.0/lib/gmt/plugins/supplements.so
    pygmt-session [DEBUG]: GMT now running in modern mode [Session ID = 7096]
    pygmt-session [DEBUG]: GMT_Call_Command string: gmt gmtset FONT_LABEL=auto,Helvetica,black FONT_ANNOT_PRIMARY=32p,Courier,blue GMT_VERBOSE=warning
    pygmt-session [DEBUG]: Revised options: FONT_LABEL=auto,Helvetica,black FONT_ANNOT_PRIMARY=32p,Courier,blue GMT_VERBOSE=warning
    
  5. yvonnefroehlich commented on Jul 17, 2026

    @yvonnefroehlich
    Member

    This is a know (long-term) issue with pygmt.config(). Currently it only works when it is called after setting up the pygmt.Figure() instance. This is the case for both global and local changes.

    xref:

    Maybe we should add a note to the documentation at https://www.pygmt.org/v0.19.0/api/generated/pygmt.config.html until we have a fix for this.

  6. seisman commented on Jul 19, 2026

    @seisman
    Member

    @yvonnefroehlich is right. See #733 (comment) for a more detailed explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions