Gönderen Konu: [Çözüldü] Python matplotlib Font sorunu  (Okunma sayısı 2952 defa)

Çevrimdışı G-khan

  • Yeni Penguen
  • *
  • İleti: 50
  • Gökyüzüne aşık bir adam.
    • https://twitter.com/g_khana
  • Dağıtım: Linux Mint 17.3,2
  • Masaüstü Ortamı: Cinnamon
  • Grafik Kartı: NVIDIA GeForce GT 650M & Intel HD Graphics 4000
  • İşlemci: Intel Core i7 3610QM
[Çözüldü] Python matplotlib Font sorunu
« : 12 Ekim 2015, 01:45:45 »
Python Kod bloğu:
Kod: [Seç]
import sys
# append tinyfacerec to module search path
sys.path.append("..")
# import numpy and matplotlib colormaps
import numpy as np
# import tinyfacerec modules
from tinyfacerec.subspace import pca
from tinyfacerec.util import normalize, asRowMatrix, read_images
from tinyfacerec.visual import subplot

# read images
[X,y] = read_images("/home/gkhan/yalefaces/orl_faces")
# perform a full pca
[D, W, mu] = pca(asRowMatrix(X), y)

import matplotlib.cm as cm

# turn the first (at most) 16 eigenvectors into grayscale
# images (note: eigenvectors are stored by column!)
E = []
for i in xrange(min(len(X), 16)):
e = W[:,i].reshape(X[0].shape)
E.append(normalize(e,0,255))
# plot them and store the plot to "python_eigenfaces.pdf"
subplot(title="Eigenfaces AT&T Facedatabase", images=E, rows=4, cols=4, sptitle="Eigenface", colormap=cm.jet, filename="python_pca_eigenfaces.pdf")

from tinyfacerec.subspace import project, reconstruct

# reconstruction steps
steps=[i for i in xrange(10, min(len(X), 320), 20)]
E = []
for i in xrange(min(len(steps), 16)):
numEvs = steps[i]
P = project(W[:,0:numEvs], X[0].reshape(1,-1), mu)
R = reconstruct(W[:,0:numEvs], P, mu)
# reshape and append to plots
R = R.reshape(X[0].shape)
E.append(normalize(R,0,255))
# plot them and store the plot to "python_reconstruction.pdf"
subplot(title="Reconstruction AT&T Facedatabase", images=E, rows=4, cols=4, sptitle="Eigenvectors", sptitles=steps, colormap=cm.gray, filename="python_pca_reconstruction.pdf")

Hata Kodu :
Kod: [Seç]
/home/gkhan/Envs/cv/local/lib/python2.7/site-packages/matplotlib/font_manager.py:1282: UserWarning: findfont: Font family [u'Tahoma'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))


Çözüm için;
home klasörü altında .cache klasörünü bulup bu dosyaları silerseniz sorun çözülmüş olacaktır.
Kod: [Seç]
~/.cache/matplotlib/
~/.matplotlib/
« Son Düzenleme: 14 Ekim 2015, 15:04:00 Gönderen: G-khan »
Gökyüzüne aşık bir adam..