Skip to content

fig.text() doesn't work if "text" is integer or float #706

@seisman

Description

@seisman

Description of the problem

Full code that generated the error

import pygmt
fig = pygmt.Figure()
fig.basemap(region=[0, 10, 0, 10], projection="X10c/10c", frame=True)
fig.text(x=5, y=5, text=5)
fig.show()

Full error message

text [ERROR]: Text record line 0 is NULL! Skipped but this is trouble)

It works before, but fails in recent releases.

System information

Please paste the output of python -c "import pygmt; pygmt.show_versions()":

PyGMT information:
  version: v0.2.2.dev9+g0cb8b609
System information:
  python: 3.8.3 (default, Jul  2 2020, 11:26:31)  [Clang 10.0.0 ]
  executable: /Users/seisman/.anaconda/bin/python
  machine: macOS-10.15.7-x86_64-i386-64bit
Dependency information:
  numpy: 1.19.2
  pandas: 1.1.4
  xarray: 0.16.1
  netCDF4: 1.5.4
  packaging: 20.4
  ghostscript: 9.53.3
  gmt: 6.2.0_d266c30_2020.11.25
GMT library information:
  binary dir: /Users/seisman/.anaconda/bin
  cores: 8
  grid layout: rows
  library path: /Users/seisman/local/GMT/lib/libgmt.dylib
  padding: 2
  plugin dir: /Users/seisman/local/GMT/lib/gmt/plugins
  share dir: /Users/seisman/local/GMT/share
  version: 6.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions