Only supported for TrueType fonts在jupyter notebook
时间: 2023-09-20 11:03:34 浏览: 676
这错误通常发生在使用 Matplotlib 绘图时,因为 Matplotlib 默认使用的是 Type 3 字体格式,而某些字体不支持该格式。解决这个问题的方法是将 Matplotlib 的字体设置为 TrueType 格式。
你可以通过以下代码在 Jupyter Notebook 中设置 Matplotlib 的字体:
```python
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
```
这将把 Matplotlib 的字体格式设置为 TrueType,从而解决这个问题。
相关问题
Only supported for TrueType fonts
This message usually appears when you are trying to use a font file that is not in the TrueType format. TrueType is a widely used font format that is supported by most modern operating systems and applications. If you encounter this message, you may need to obtain a TrueType version of the font or use another font that is already installed on your system.
pycharm Only supported for TrueType fonts
这是一个错误信息,它意味着 PyCharm 只支持 TrueType 字体。如果您想在 PyCharm 中使用其他类型的字体,您需要将它们转换为 TrueType 字体格式。您可以使用一些免费或付费的字体转换工具来完成这项任务。但是,如果您不需要更改字体,您可以尝试在 PyCharm 的设置中更改字体,以找到一个适合您的 TrueType 字体。
阅读全文
相关推荐









