【问题标题】:Stop matplotlib from using the Arial font停止 matplotlib 使用 Arial 字体
【发布时间】:2015-01-08 23:47:24
【问题描述】:

我在 ubuntu 14.04 上使用 matplotlib

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

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

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

【问题讨论】:

标签: python ubuntu matplotlib fonts


【解决方案1】:

根据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 上的 cmets 应该。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-07
    • 2011-01-04
    • 2011-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    • 1970-01-01
    相关资源
    最近更新 更多