Python Matplotlib-单空间字体和格式错误警告
运行中的代码没有任何更改,但现在我遇到了这个错误,我不知道该怎么办:Python Matplotlib-单空间字体和格式错误警告,python,matplotlib,Python,Matplotlib,运行中的代码没有任何更改,但现在我遇到了这个错误,我不知道该怎么办: /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1224: UserWarning: findfont: Font family ['monospace'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1224: UserWarning: findfont: Font family ['monospace'] not found. Falling back to Bitstream Vera Sans
(prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/IPython/core/formatters.py:239: FormatterWarning: Exception in image/png formatter: Locator attempting to generate 20001 ticks from 0.0 to 100.0: exceeds Locator.MAXTICKS
FormatterWarning,
这句话对我起了作用
sudo pacman -S dina-font
这里是网页的字体
如果您不在Linux上,则必须下载该文件并将其存储在适当的文件夹中。这些是:
# OS Font paths
MSFolders = \
r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'
MSFontDirectories = [
r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts',
r'SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts']
X11FontDirectories = [
# an old standard installation point
"/usr/X11R6/lib/X11/fonts/TTF/",
"/usr/X11/lib/X11/fonts",
# here is the new standard location for fonts
"/usr/share/fonts/",
# documented as a good place to install new fonts
"/usr/local/share/fonts/",
# common application, not really useful
"/usr/lib/openoffice/share/fonts/truetype/",
]
OSXFontDirectories = [
"/Library/Fonts/",
"/Network/Library/Fonts/",
"/System/Library/Fonts/",
# fonts installed via MacPorts
"/opt/local/share/fonts"
""
]
monospace字体是否仍在安装?另外,
FormatterWarning
非常直截了当地告诉您出了什么问题。我认为这是在转移注意力。完全相同的代码工作正常,没有任何警告。顺便说一句,我该如何解决单空格字体的问题?我们不能帮助你的代码。