Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[MNT]: pyplot.xkcd() leads to findfont errors under Windows  #27350

Copy link
Copy link
Open
@bkasel

Description

@bkasel
Issue body actions

Summary

any plot with the xkcd style pyplot.xkcd() generates a bunch of errors from the findfont function under Windows even when fonts like "Comic Neue" are installed. I also regenerated the font cache and copied the font files into the matplotlib site-packages font folder, but this did not help. (I am using mpl 3.8.2 on python 3.11)

I am unsure if this is an issue under other OSs but I have the same issue under Win10 and Win11

Proposed fix

In the end I modified the pyplot.py file in the xkcd function, to get rid of the errors

    rcParams.update({
        'font.font-family': ['xkcd', 'xkcd Script', 'Comic Neue', 'Comic Sans MS'],
...

to

   rcParams.update({
       'font.sans-serif': ['xkcd', 'xkcd Script', 'Comic Neue', 'Comic Sans MS'],
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.