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

error saving pcolormesh with shading=gouraud to eps #8263

Closed
bendichter opened this issue Mar 10, 2017 · 2 comments
Closed

error saving pcolormesh with shading=gouraud to eps #8263

bendichter opened this issue Mar 10, 2017 · 2 comments

Comments

@bendichter
Copy link

Bug report

Bug summary
I have a pcolormesh that has shading='gouraud', and I am trying to save it to an .eps. Saving it to a pdf works fine, but trying to save to an eps gives an error.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np
plt.pcolormesh(np.random.randn(10,10), shading='gouraud')
plt.gcf().savefig('test.eps')

Actual outcome

    168 def quote_ps_string(s):
    169     "Quote dangerous characters of S for use in a PostScript string constant."
--> 170     s=s.replace("\\", "\\\\")
    171     s=s.replace("(", "\\(")
    172     s=s.replace(")", "\\)")

TypeError: a bytes-like object is required, not 'str'

Matplotlib version
matplotlib 1.5.1
'3.5.1 |Anaconda 2.4.1 (x86_64)| (default, Dec 7 2015, 11:24:55) \n[GCC 4.2.1 (Apple Inc. build 5577)]'
OS X

I fixing this might just require adding a 'b' before these strings.

@tacaswell
Copy link
Member

Thanks for reporting this.

I believe this was fixed in 1.5.2 via 97953f3 in #6282 and a duplicate of #6226

Can you update to a newer version of mpl?

Closing as already fixed, please ping to be re-opened if you can reproduce this with a newer version of mpl.

@QuLogic QuLogic added this to the v1.5.2 milestone Mar 10, 2017
@bendichter
Copy link
Author

yup, that worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants