|
From: Zachary P. <zac...@ya...> - 2012-03-19 14:45:31
|
Or, more likely, PEBCAK, but here goes: Following along with this example: http://matplotlib.sourceforge.net/examples/api/font_family_rc.html I tried the following (changing to comic sans so that "success" would be clear): from matplotlib import rcParams rcParams['font.family'] = 'sans-serif' rcParams['font.sans-serif'] = ['Comic Sans MS'] import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,2,3], label='test') ax.legend() plt.show() However, the above does not result in "Comic Sans" on the plot... (Thank god, but still, that doesn't seem correct wrt the stated behavior from the example.) The below, however, does get comic sans: from matplotlib import rcParams rcParams['font.family'] = 'Comic Sans MS' import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,2,3], label='test') ax.legend() plt.show() Is this a known issue / feature / mis-comprehension on my part? Otherwise I'll try digging through the code to find the problem. Thanks, Zach |