Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting font type using rcParams does not work under Python 3.* #1978

Merged
merged 1 commit into from May 6, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented May 6, 2013

The following code:

import matplotlib as mpl
import matplotlib.pyplot as plt
# if I omit the next line, the plot saves without error, but with outlined fonts
mpl.rcParams['pdf.fonttype'] = 42        #set Truetype fonts for Adobe
plt.plot(range(5),range(5),'r-')
plt.ylabel('y')
plt.xlabel('x')
plt.title('title')
plt.savefig("myfig.pdf")

runs fine in Python 2.7.3, but causes TypeError: 'str' does not support the buffer interface error in Python 3.3 on OsX and Python 3.2.3 on Linux.

(se also http://stackoverflow.com/questions/16391280/python-3-3-matplotlib-1-2-0-pdf-export-generates-str-does-not-support-the )

@mdboom
Copy link
Member

mdboom commented May 6, 2013

Can you confirm the attached patch resolves your issue?

@ghost ghost assigned mdboom May 6, 2013
@lahvak
Copy link
Author

lahvak commented May 6, 2013

Yes, it seems to work fine on Linux, with Python 3.2.3.

mdboom added a commit that referenced this pull request May 6, 2013
Setting font type using rcParams does not work under Python 3.*
@mdboom mdboom merged commit 0c3768e into matplotlib:v1.2.x May 6, 2013
@mwinkler13
Copy link

It also works on OSX with Python 3.3.0. Thanks!

@mdboom mdboom deleted the type42-python3 branch August 7, 2014 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants