Wie man matplotlib findfont behebt: Font family 'xkcd' not found auf Ubuntu 22.04+
Problem:
Beim Plotten eines XKCD-Stil-Plots mit matplotlib sehen Sie die folgenden Fehlermeldungen:
install_humor_sans.sh
findfont: Font family 'xkcd' not found.
findfont: Font family 'xkcd Script' not found.
findfont: Font family 'Comic Neue' not found.
findfont: Font family 'Comic Sans MS' not found.Lösung
Installieren Sie die Humor Sans-Schriftart mit
install_humor_sans.sh
sudo apt -y install font-humor-sansZusätzlich müssen Sie den matplotlib-Schriftart-Cache entfernen:
clear_matplotlib_font_cache.sh
rm -rf ~/.cache/matplotlibIf this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow