Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The PDF backend does not currently support the selected font

Hey im trying to save a matplotlib figure as pdf file with Palatino font. Im using the font manager as follos:

prop = font_manager.FontProperties(family = 'Palatino', fname = '/Users/kalex/Library/Fonts/Palatino.ttc')

Im getting the the error:

The PDF backend does not currently support the selected font.

Does anybody know what to do?

like image 976
eax Avatar asked Dec 31 '22 08:12

eax


1 Answers

I ran into the same problem when I upgraded my mac to Catalina and did a fresh install of Anaconda Python. Out of the box, without trying to load any special font, I got the same "The PDF backend does not currently support the selected font." error.

I found the solution here.

Here is what I added to my Python script:

import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'serif','serif':['Palatino']})
plt.rcParams['pdf.fonttype'] = 42
like image 110
rmcdermo Avatar answered Jan 25 '23 22:01

rmcdermo