Skip to content

The solution of display chinese in seaborn plot #1009

@githubzhanglei

Description

@githubzhanglei

As #829 and #592 said, the reason is "seaborn override default fonts specified in matplotlibrc configs".
Thus, you can set the default seaborn font style after import the seaborn as follows:

import seaborn as sns
sns.set_style("darkgrid",{"font.sans-serif":['simhei', 'Arial']})

The simhei is the chinese font, and make sure the simhei.ttf already in your "Lib\site-packages\matplotlib\mpl-data\fonts\ttf" folder.

This method just change the seaborn font setting temporarily, however I do not know how to do that permanently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions