python - 停止 matplotlib 使用 Arial 字体

标签 python ubuntu matplotlib fonts

我在 ubuntu 14.04 上使用 matplotlib

我正在尝试控制用于在 matplotlib 中绘图的字体。我的理解是,如果你想使用 LaTeX 支持,就不可能完全控制字体。但是,我想从 matplotlib 可以使用的字体列表中排除 Arial,因为我觉得它很难阅读。

我的另一台 Ubuntu 机器上的 Matplotlib 默认为我喜欢的更干净的无衬线字体(不确定是哪个,我认为是 DejaVu?)。但是,我无法说服 matplotlib 在这台机器上表现类似。

我将通过简单地从我的系统中删除 Arial 字体来实现这一点——但肯定有更好的方法吗?

最佳答案

根据http://matplotlib.org/users/customizing.html ,您应该能够通过取消注释和适本地编辑该行来自定义可以为给定系列选择的字体:

#font.sans-serif     : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif

在您的 matplotlibrc文件。我尚未验证这适用于 LaTex 模式,但根据该 URL 上的评论,它应该。

关于python - 停止 matplotlib 使用 Arial 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27851625/

相关文章:

ubuntu - 安装 Webmin - dpkg : unable to access dpkg status area

python - Seaborn pairplot 使用 anaconda 和 pycharm 无法正常工作。获得自由度警告

python - 如何让 argparse 检查互斥的参数组

python - 从 imp 到 importlib 的过渡

python - 如何知道 ImageDataGenerator() 将哪个标签分配给哪个图像类?

python - 如何从python中的另一个类调用函数?

ubuntu - 用于 Tomcat8 的 SAML2

python - 使用 Django 在另一台服务器上创建 PostgreSQL 数据库

python - 绘制非多项式多元隐式方程

python - matplotlib - 动态向图形添加 slider