在本地使用 matplotlib 中的自定义字体涉及将.ttfs存储在matplotlib/mpl-data/fonts/ttf/文件夹中,然后调用mpl.font_manager._rebuild(),然后设置mpl.rcParams['font.sans-serif']。
有没有办法在 Google Colaboratory 中执行此操作,但似乎无法ttf访问此文件夹?
例如,我想使用Roboto 字体。安装后,这将使用mpl.rcParams['font.sans-serif'] = 'Roboto'.