代码之家  ›  专栏  ›  技术社区  ›  gerrit

什么替代了text.latex.unicode?

  •  2
  • gerrit  · 技术社区  · 7 年前

    在我的 matplotlibrc text.latex.unicode rcparam,如文件中(仍然)建议的:

    #text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling
                                # unicode strings.
    
    text.latex.unicode : True
    

    但是自从Matplotlib 3.0以来,我得到了一个MatplotlibDeprecationWarning:

    /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/site-packages/matplotlib/__init__.py:846: MatplotlibDeprecationWarning:
    The text.latex.unicode rcparam was deprecated in Matplotlib 2.2 and will be removed in 3.1.
      "2.2", name=key, obj_type="rcparam", addendum=addendum)
    /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/site-packages/matplotlib/__init__.py:846: MatplotlibDeprecationWarning:
    The text.latex.unicode rcparam was deprecated in Matplotlib 2.2 and will be removed in 3.1.
      "2.2", name=key, obj_type="rcparam", addendum=addendum)
    

    不推荐使用的替代品是什么 text.latex.unicode编码 rcparam?

    不幸的是,我似乎无法到达 Matplotlib Tex Cookbook 目前。

    1 回复  |  直到 7 年前
        1
  •  5
  •   ImportanceOfBeingErnest    7 年前

    这个 api change notes 告诉我们

    text.latex.unicode rcParam参数
    rcParam现在默认为True,不推荐使用(即,在将来的Maplotlib版本中,将始终支持unicode输入)。
    \usepackage[utf8]{inputenc} 而不是 \usepackage{ucs}\usepackage[utf8x]{inputenc} .

    这本质上意味着,如果使用matplotlib 2.2或更高版本,应该完全忽略该参数。

    the example of the current documentation 在没有使用此类参数的情况下。

    还有 current version of the rc file