Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

error saving pcolormesh with shading=gouraud to eps #8263

Copy link
Copy link
Closed
@bendichter

Description

@bendichter
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.