Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What replaces text.latex.unicode?

In my matplotlibrc, I'm using the text.latex.unicode rcparam, as (still) recommended by the documentation:

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

text.latex.unicode : True

But since Matplotlib 3.0, I am getting a 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)

What is the replacement for the deprecated text.latex.unicode rcparam?

Unfortunately, I can't seem to reach the Matplotlib Tex Cookbook at the moment.

like image 223
gerrit Avatar asked Nov 05 '18 15:11

gerrit


1 Answers

The api change notes tell us

Changes regarding the text.latex.unicode rcParam
The rcParam now defaults to True and is deprecated (i.e., in future versions of Maplotlib, unicode input will always be supported).
Moreover, the underlying implementation now uses \usepackage[utf8]{inputenc} instead of \usepackage{ucs}\usepackage[utf8x]{inputenc}.

This essentially means that if you use matplotlib 2.2 or higher, you should just leave that parameter out completely.

This is also reflected in the example of the current documentation where there is no such parameter used.

Also the current version of the rc file does not even have this parameter in it.

like image 159
ImportanceOfBeingErnest Avatar answered Nov 19 '22 14:11

ImportanceOfBeingErnest