Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python matplotlib需要哪种latex字体?如何使其可用?_Python_Matplotlib_Fonts_Latex_Ubuntu 16.04 - Fatal编程技术网

Python matplotlib需要哪种latex字体?如何使其可用?

Python matplotlib需要哪种latex字体?如何使其可用?,python,matplotlib,fonts,latex,ubuntu-16.04,Python,Matplotlib,Fonts,Latex,Ubuntu 16.04,下面运行的小示例的错误跟踪表明它找不到cmr12font。我在我的系统(Ubuntu 16.10)中发现了以下文件: 那么,matplotlib需要哪种字体,以及如何使其可用?另外,为什么要查找的matplotlib字体文件没有扩展名 以下是跟踪: Traceback (most recent call last): File "temp.py", line 45, in <module> d['ModDate'] = datetime.datetime.today()

下面运行的小示例的错误跟踪表明它找不到
cmr12
font。我在我的系统(Ubuntu 16.10)中发现了以下文件:

那么,matplotlib需要哪种字体,以及如何使其可用?另外,为什么要查找的
matplotlib
字体文件没有扩展名

以下是跟踪:

Traceback (most recent call last):
  File "temp.py", line 45, in <module>
    d['ModDate'] = datetime.datetime.today()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2435, in __exit__
    self.close()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2442, in close
    self._file.close()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 547, in close
    self.writeFonts()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 647, in writeFonts
    realpath, stat_key = get_realpath_and_stat(filename)
  File "/usr/lib/python2.7/dist-packages/matplotlib/cbook.py", line 1038, in __call__
    stat = os.stat(realpath)
OSError: [Errno 2] No such file or directory: '/home/meir/Dropbox/temp/cmr12'

您可以检查是否安装了cm super包,删除主页中~/.cache/matplotlib目录的内容,然后在end@GerardRozsavolgyi错误仍然存在。我已经用
--verbose debug
运行的输出更新了帖子。与latex相关的哪些信息是用matplotlibrc编写的?将“text.usetex:True font.family:serif font.serif:cm”添加到此文件。@Serenity我不明白建议:我应该将此行添加到哪个文件中,以及此行应该放在文件中的什么位置?阅读此主题
Traceback (most recent call last):
  File "temp.py", line 45, in <module>
    d['ModDate'] = datetime.datetime.today()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2435, in __exit__
    self.close()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2442, in close
    self._file.close()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 547, in close
    self.writeFonts()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 647, in writeFonts
    realpath, stat_key = get_realpath_and_stat(filename)
  File "/usr/lib/python2.7/dist-packages/matplotlib/cbook.py", line 1038, in __call__
    stat = os.stat(realpath)
OSError: [Errno 2] No such file or directory: '/home/meir/Dropbox/temp/cmr12'
$HOME=/home/meir
matplotlib data path /usr/share/matplotlib/mpl-data

*****************************************************************
You have the following UNSUPPORTED LaTeX preamble customizations:

Please do not ask for support with these customizations active.
*****************************************************************

loaded rc file /etc/matplotlibrc
matplotlib version 1.5.1
verbose.level debug
interactive is False
platform is linux2
loaded modules: <dictionary-keyiterator object at 0x7fa923c0d7e0>
CACHEDIR=/home/meir/.cache/matplotlib
Using fontManager instance from /home/meir/.cache/matplotlib/fontList.cache
backend TkAgg version 8.6
findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=400:stretch=normal:size=medium to Bitstream Vera Sans (u'/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf') with score of 0.000000
Assigning font /F1 = u'/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf'
findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=400:stretch=normal:size=large to Bitstream Vera Sans (u'/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf') with score of 0.000000
Dvi: /home/meir/.cache/matplotlib/tex.cache/1d97300a39adbdb822e515e35e631e34.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
find_tex_file(phvr7t.tfm): [u'kpsewhich', u'phvr7t.tfm']
find_tex_file result: /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr7t.tfm
opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr7t.tfm
lh=18, bc=0, ec=170, nw=17, nh=16, nd=16
find_tex_file(phvr7t.vf): [u'kpsewhich', u'phvr7t.vf']
find_tex_file result: /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvr7t.vf
Dvi: /usr/share/texlive/texmf-dist/fonts/vf/adobe/helvetic/phvr7t.vf
find_tex_file(phvr8r.tfm): [u'kpsewhich', u'phvr8r.tfm']
find_tex_file result: /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8r.tfm
opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/adobe/helvetic/phvr8r.tfm
lh=18, bc=1, ec=255, nw=30, nh=16, nd=16
find_tex_file(phvr8r.vf): [u'kpsewhich', u'phvr8r.vf']
find_tex_file result: 
Dvi._xxx: encountered special: Warning: missing glyph `Gamma'
Dvi._xxx: encountered special: Warning: missing glyph `Delta'
Dvi._xxx: encountered special: Warning: missing glyph `Theta'
Dvi._xxx: encountered special: Warning: missing glyph `Lambda'
Dvi._xxx: encountered special: Warning: missing glyph `Xi'
Dvi._xxx: encountered special: Warning: missing glyph `Pi'
Dvi._xxx: encountered special: Warning: missing glyph `Sigma'
Dvi._xxx: encountered special: Warning: missing glyph `Upsilon'
Dvi._xxx: encountered special: Warning: missing glyph `Phi'
Dvi._xxx: encountered special: Warning: missing glyph `Psi'
Dvi._xxx: encountered special: Warning: missing glyph `Omega'
Dvi._xxx: encountered special: Warning: missing glyph `dotlessj'
Dvi._xxx: encountered special: Warning: missing glyph `lslashslash'
Dvi: /home/meir/.cache/matplotlib/tex.cache/d0e4b65f3cbceaa40d39cd0b4aa94322.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
find_tex_file(cmr12.tfm): [u'kpsewhich', u'cmr12.tfm']
find_tex_file result: ./cmr12.tfm
opening tfm file ./cmr12.tfm
lh=18, bc=0, ec=127, nw=34, nh=16, nd=10
find_tex_file(cmr12.vf): [u'kpsewhich', u'cmr12.vf']
find_tex_file result: 
Dvi: /home/meir/.cache/matplotlib/tex.cache/1d97300a39adbdb822e515e35e631e34.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/04a76deccffda905e8691101fef1fc76.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/1d97300a39adbdb822e515e35e631e34.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/bbd64720c31d6f90a40311f23be42459.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/1d97300a39adbdb822e515e35e631e34.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/fe6359652f3a3d1ffea98277430a2e0d.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/1d97300a39adbdb822e515e35e631e34.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/4f1d4aac6b5a9606c9b7534411317104.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/1d97300a39adbdb822e515e35e631e34.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/75f66faa7396d6de47d7fef88d0cdf18.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Dvi: /home/meir/.cache/matplotlib/tex.cache/d0e4b65f3cbceaa40d39cd0b4aa94322.dvi
Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt
Assigning font /F2 = 'cmr12'
find_tex_file(pdftex.map): [u'kpsewhich', u'pdftex.map']
find_tex_file result: /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
Embedding font /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf
Writing TrueType font
Embedding font cmr12
Writing TrueType font
Traceback (most recent call last):
  File "temp.py", line 49, in <module>
    d['ModDate'] = datetime.datetime.today()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2435, in __exit__
    self.close()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2442, in close
    self._file.close()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 547, in close
    self.writeFonts()
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 647, in writeFonts
    realpath, stat_key = get_realpath_and_stat(filename)
  File "/usr/lib/python2.7/dist-packages/matplotlib/cbook.py", line 1038, in __call__
    stat = os.stat(realpath)
OSError: [Errno 2] No such file or directory: '/home/meir/Dropbox/temp/cmr12'