|
| 1 | +# Environment Variables |
| 2 | + |
| 3 | +PyGMT's behavior can be controlled through various environment variables. These variables |
| 4 | +can be set either in your shell environment or within your Python script using the |
| 5 | +{py:data}`os.environ` dictionary. |
| 6 | + |
| 7 | +Here we list the environment variables used by PyGMT which are categorized into three groups: |
| 8 | + |
| 9 | +1. System environment variables |
| 10 | +2. GMT/PyGMT environment variables |
| 11 | +3. Module-specific environment variables |
| 12 | + |
| 13 | +## System Environment Variables |
| 14 | + |
| 15 | +```{glossary} |
| 16 | +TZ |
| 17 | + Specify the time zone for the current calendar time. It can be set to a string that |
| 18 | + defines the timezone, such as `"UTC"`, `"America/New_York"`, or `"Europe/London"`. |
| 19 | + Refer to [Specifying the Time Zone with TZ](https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html) |
| 20 | + for the valid format. If not set, the system's default timezone is used. |
| 21 | +``` |
| 22 | + |
| 23 | +## GMT/PyGMT Environment Variables |
| 24 | + |
| 25 | +```{glossary} |
| 26 | +GMT_LIBRARY_PATH |
| 27 | + Specify the directory where the GMT shared library is located. This is useful when |
| 28 | + GMT is installed in a non-standard location or when you want to use a specific |
| 29 | + version of GMT. If not set, PyGMT will attempt to find the GMT library in standard |
| 30 | + system locations. |
| 31 | +
|
| 32 | +PYGMT_USE_EXTERNAL_DISPLAY |
| 33 | + Whether to use external viewers for displaying images. If set to `"false"`, PyGMT |
| 34 | + will not attempt to open images in external viewers. This can be useful when running |
| 35 | + tests or building the documentation to avoid popping up windows. |
| 36 | +``` |
| 37 | + |
| 38 | +## Module-Specific Environment Variables |
| 39 | + |
| 40 | +```{glossary} |
| 41 | +X2SYS_HOME |
| 42 | + Specify the directory where x2sys databases and related settings will be stored. |
| 43 | + This environment variable is used by x2sys-related functions (e.g., |
| 44 | + {func}`pygmt.x2sys_init`) to manage and access x2sys data. If not set, these |
| 45 | + functions will use a default directory or prompt for a location. |
| 46 | +``` |
0 commit comments