Skip to content

Breaking change in how text strings are treated #3457

@MarkWieczorek

Description

@MarkWieczorek

Description of the problem

I have a code that makes use of pygmt that works fine. After an upgrade to 0.12/0.13 however, many of my titles and axis labels have quotes around them. This is because I am specifying gmt parameters such as the title like '+t"This is my title"'. This used to work in all previous versions.

It is not clear if this is a bug, or if this is a breaking change. If pygmt changed how they parse strings for gmt options, that is fine, but I would like to make sure before changing my code.
test

Minimal Complete Verifiable Example

fig = pygmt.Figure()

title = 'my title'

fig.basemap(
    region=[0, 10, -1.5, 1.5],
    projection="X10c",
    frame=['WSne+t"this is {:}"'.format(title), "xa2f1", "ya1f0.1"],
)

fig.show()

Full error message

No response

System information

PyGMT information:
  version: v0.13.0
System information:
  python: 3.12.5 | packaged by conda-forge | (main, Aug  8 2024, 18:36:51) [GCC 12.4.0]
  executable: /home/mrak/miniforge3/envs/py312/bin/python
  machine: Linux-6.10.10-200.fc40.x86_64-x86_64-with-glibc2.39
Dependency information:
  numpy: 2.1.0
  pandas: 2.2.2
  xarray: 2024.7.0
  netCDF4: 1.7.1
  packaging: 24.1
  contextily: None
  geopandas: None
  IPython: 8.26.0
  rioxarray: None
  gdal: 3.9.2
  ghostscript: 10.03.1
GMT library information:
  version: 6.5.0
  padding: 2
  share dir: /home/mrak/miniforge3/envs/py312/share/gmt
  plugin dir: /home/mrak/miniforge3/envs/py312/lib/gmt/plugins
  library path: /home/mrak/miniforge3/envs/py312/lib/libgmt.so
  cores: 20
  grid layout: rows
  image layout: 
  binary version: 6.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions