Skip to content

matplotlab chinese font messy code #33

Open
@Terrency

Description

@Terrency

🐛 Bug

I am using Pyodide to run matplotlab pie with chinese font label, but display nothing.

To Reproduce

import matplotlib.pyplot as plt
kinds = ["中文1", "中文2", "中文3","中文4"]
percentage = [0.0881, 0.3964, 0.4955, 0.0198 ]
plt.figure(figsize=(10,8))
plt.pie(x=percentage, labels=kinds, textprops= {"fontsize":13, "color":"w"})

plt.rcParams[ 'font.family' ] = [ 'Microsoft YaHei' ]
plt.rcParams[ 'axes.unicode_minus' ] = False
plt.title("中文4", fontsize=13, color="w")
plt.legend(loc=4, fontsize=12)
plt.show()
plt

Expected behavior

in windows and mac python runtime, we need to find the right font to display the right font

Environment

  • Pyodide Version:0.21.2
  • Browser version:109.0.5414.120
  • Any other relevant information: call from pyscript

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