René's URL Explorer Experiment
Title: Bug in postscript backend in Python 3 by mdboom · Pull Request #1779 · matplotlib/matplotlib · GitHub
Open Graph Title: Bug in postscript backend in Python 3 by mdboom · Pull Request #1779 · matplotlib/matplotlib
X Title: Bug in postscript backend in Python 3 by mdboom · Pull Request #1779 · matplotlib/matplotlib
Description: The following examples demonstrates the issue:
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '1.2.0'
In [3]: from matplotlib import pyplot as plt
In [4]: fig = plt.figure()
In [5]: ax = fig.add_subplot(1,1,1)
In [6]: import numpy as np
In [7]: ax.imshow(np.zeros((128, 128)))
Out[7]:
In [8]: fig.savefig('test.ps')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 fig.savefig('test.ps')
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs)
1362 kwargs.setdefault('edgecolor', rcParams['savefig.edgecolor'])
1363
-> 1364 self.canvas.print_figure(*args, **kwargs)
1365
1366 if transparent:
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
2091 orientation=orientation,
2092 bbox_inches_restore=_bbox_inches_restore,
-> 2093 **kwargs)
2094 finally:
2095 if bbox_inches and restore_bbox:
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backend_bases.py in print_ps(self, *args, **kwargs)
1858 from .backends.backend_ps import FigureCanvasPS # lazy import
1859 ps = self.switch_backends(FigureCanvasPS)
-> 1860 return ps.print_ps(*args, **kwargs)
1861
1862 def print_raw(self, *args, **kwargs):
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in print_ps(self, outfile, *args, **kwargs)
969
970 def print_ps(self, outfile, *args, **kwargs):
--> 971 return self._print_ps(outfile, 'ps', *args, **kwargs)
972
973 def print_eps(self, outfile, *args, **kwargs):
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in _print_ps(self, outfile, format, *args, **kwargs)
1005 self._print_figure(outfile, format, imagedpi, facecolor, edgecolor,
1006 orientation, isLandscape, papertype,
-> 1007 **kwargs)
1008
1009 def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w',
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in _print_figure(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype, **kwargs)
1098 bbox_inches_restore=_bbox_inches_restore)
1099
-> 1100 self.figure.draw(renderer)
1101
1102 if dryrun: # return immediately if dryrun (tightbbox=True)
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/figure.py in draw(self, renderer)
998 dsu.sort(key=itemgetter(0))
999 for zorder, a, func, args in dsu:
-> 1000 func(*args)
1001
1002 renderer.close_group('figure')
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/axes.py in draw(self, renderer, inframe)
2086
2087 for zorder, a in dsu:
-> 2088 a.draw(renderer)
2089
2090 renderer.close_group('axes')
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/image.py in draw(self, renderer, *args, **kwargs)
364 im._url = self.get_url()
365 im._gid = self.get_gid()
--> 366 renderer.draw_image(gc, l, b, im)
367 gc.restore()
368
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/matplotlib/backends/backend_ps.py in draw_image(self, gc, x, y, im, dx, dy, transform)
470
471 h, w, bits, imagecmd = self._get_image_h_w_bits_command(im)
--> 472 hexlines = '\n'.join(self._hex_lines(bits))
473
474 if dx is None:
TypeError: sequence item 0: expected str instance, bytes found
In the mean time, is there a workaround?
Open Graph Description: The following examples demonstrates the issue:
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '1.2.0'
In [3]: from matplotlib import pyplot as plt
In [4]: fig = plt.fig...
X Description: The following examples demonstrates the issue:
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '1.2.0'
In [3]: from matplotlib import pyplot as plt
In [4]: fig =...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/1779
X: @github
direct link
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:746e72ac-d493-2a8d-1183-a9ea73a2f02e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DA26:3BEBFA:A90768:E594C9:6A542A28 |
| html-safe-nonce | 1f1731e3c6c52370df2a6d3854e9b20006615ff599dcb7d5918bffbbfb066171 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTI2OjNCRUJGQTpBOTA3Njg6RTU5NEM5OjZBNTQyQTI4IiwidmlzaXRvcl9pZCI6IjU0NzUzODYwMTE5NDg0Mjc4MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d6da21552b95956e88a55c92c5a078814d1818fa487d9c77351397a6ba998294 |
| hovercard-subject-tag | pull_request:4305096 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/1779/files |
| twitter:image | https://avatars.githubusercontent.com/u/38294?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/38294?s=400&v=4 |
| og:image:alt | The following examples demonstrates the issue:
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '1.2.0'
In [3]: from matplotlib import pyplot as plt
In [4]: fig = plt.fig... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width
URLs of crawlers that visited me.