0

I got a problem with matplolib, when I want change font on matplotlib at Linux(Ubuntu Distribution) Server.
It didnot display Chinese or other non-ascii characters in matplotlib.
I using the following step to find matplotlib font folder

import matplotlib
print(matplotlib.matplotlib_fname())

Then download the SimHei.tff in matplotlib/font/tff folder
change the setting in matplotlibrc

Here is the problem when i try to rebuild using

from matplotlib.font_manager import _rebuild
_rebuild()

it shows the following error msg:

AttributeError:module 'matplotlib.font_manager' has no attribute '_rebuild'

  • That function was removed. This answer might help you: https://stackoverflow.com/a/70647041/9987623 – AlexK Aug 19 '22 at 23:05
  • Check out my answer for a similar question: [it is using matplotlib.font_manager](https://stackoverflow.com/questions/73336997/change-font-for-both-labels-and-ticks-on-3d-surface-plot/73341464#73341464) – Michael S. Aug 20 '22 at 02:08

0 Answers0