How to display Russian text on plots with PyGMT

Hello!
I’m trying plot with labels in Russian language but I get squiggles.
Used software: OS Windows 10 / PyGMT v0.7.0 / Python 3.9.13 (Jupyter Notebook).

I try use this code for config:

pygmt.config(
    GMT_LANGUAGE="RU",
    PS_CHAR_ENCODING="ISO-8859-5",
    MAP_GRID_CROSS_SIZE_PRIMARY=0.5
)

but it didn’t work.

However, text elements from txt file work nice.
fig.text(textfiles="seas_ru.txt", angle=True, font=True, justify=True), txt file has ISO-8859-5 encoding.

Please help.

Hi @Alex, thanks for trying PyGMT! Could you copy a few lines from seas_ru.txt and paste it here? That will make it easier for us to help test things.

These related posts might help:

cc @CraneBoba and @uleysky who might be able to help.

I tried a quick script like below, but it doesn’t seem to be printing the Russian characters correctly:

import pygmt
# %%
fig = pygmt.Figure()
with pygmt.config(
    GMT_LANGUAGE="RU", PS_CHAR_ENCODING="ISO-8859-5", MAP_GRID_CROSS_SIZE_PRIMARY=0.5
):
    fig.text(x=147, y=55, text="Россия", region=[145, 150, 54, 56], frame=True)
fig.savefig("russian_text.png")
fig.show()

gives