Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Cairo text on Python3 with pycairo #4105

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

Merged
merged 1 commit into from
Feb 17, 2015
Merged

Fix Cairo text on Python3 with pycairo #4105

merged 1 commit into from
Feb 17, 2015

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Feb 16, 2015

See #2906 for explanation.

Fixes

testing cairo
        driving ..\pylab_examples\accented_text.py
Traceback (most recent call last):
  File "_tmp_accented_text.py", line 33, in <module>
    savefig(r"cairo\accented_text", dpi=150)
  File "X:\Python34\lib\site-packages\matplotlib\pyplot.py", line 577, in savefig
    res = fig.savefig(*args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\figure.py", line 1476, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\backend_bases.py", line 2211, in print_figure
    **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\backends\backend_cairo.py", line 442, in print_png
    self.figure.draw (renderer)
  File "X:\Python34\lib\site-packages\matplotlib\artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\figure.py", line 1085, in draw
    func(*args)
  File "X:\Python34\lib\site-packages\matplotlib\artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\axes\_base.py", line 2110, in draw
    a.draw(renderer)
  File "X:\Python34\lib\site-packages\matplotlib\artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\axis.py", line 1128, in draw
    self.label.draw(renderer)
  File "X:\Python34\lib\site-packages\matplotlib\artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\text.py", line 642, in draw
    ismath=ismath, mtext=mtext)
  File "X:\Python34\lib\site-packages\matplotlib\backends\backend_cairo.py", line 194, in draw_text
    self._draw_mathtext(gc, x, y, s, prop, angle)
  File "X:\Python34\lib\site-packages\matplotlib\backends\backend_cairo.py", line 247, in _draw_mathtext
    ctx.show_text(s)
TypeError: Can't convert 'bytes' object to str implicitly

@tacaswell tacaswell modified the milestone: 1.5.0 Feb 16, 2015
@tacaswell
Copy link
Member

@mdboom @efiring @pelson What do you want to do about this? This is something that should have been back-ported and was not, but I created the 1.4.3 tag already.

Do we want to maintain a 1.4.x branch 'just in case' or drop that branch right now?

@efiring
Copy link
Member

efiring commented Feb 16, 2015

Drop it, and fold things like this into 2.0, with living color!

tacaswell added a commit that referenced this pull request Feb 17, 2015
Fix : Cairo text on Python3 with pycairo
@tacaswell tacaswell merged commit 9d66b95 into matplotlib:v1.4.x Feb 17, 2015
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.

3 participants