PyGMT text for Standard+ symbols

Hi there, I am using PyGMT in jupyter lab and find the text command does not produce the “standard+” symbols properly using the “@~” options as for the GMT in bash. Is there a solution or workaround for this?

Hello jiaor,

welcome to the GMT forum!

Can you please provide a code example and maybe an output figure showing your issue? This makes it easier for people to help you :slightly_smiling_face:.
You can format your script as code by placing three backticks in the line before and after the block with the script:

```
your script formated as code
```

Maybe your issue is related to the problem discussed in the GitHub issue: Better support of non-ASCII characters in PyGMT arguments · Issue #2204 · GenericMappingTools/pygmt (github.com)

Thanks for you reply and the reference thread. Below is an example and the output figure.

fig = pygmt.Figure()
fig.basemap(region=[0, 1, 0, 1], projection='X3c')
fig.text(x=.5, y=.5, text='@~\\251@~', font='12p')
fig.text(x=.5, y=.7, text='@~\251@~', font='12p')
fig.show()

Oh I see! No @~ is needed. The following code gives me the ISOLatin+ symbols. Thanks!

fig = pygmt.Figure()
fig.basemap(region=[0, 1, 0, 1], projection='X3c')
fig.text(x=.5, y=.5, text='\\251', font='12p')
fig.show()

Great that you found out how it works :+1:!