Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Crash with text.usetex=True and plt.annotate#1583

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdboom merged 3 commits intomatplotlib:v1.2.xfrommdboom:annotate_space
Dec 17, 2012

Conversation

mdboom
Copy link
Member

The following minimal example causes a crash on the current master:

importmatplotlibimportmatplotlib.pyplotaspltmatplotlib.rcParams['text.usetex']=Trueplt.annotate(" ", (0,0), (1,0),arrowprops=dict(arrowstyle='->'))plt.show()

If" " is changed to"" (an empty string) or if thearrowprops argument is removed, then the crash doesn't happen. Here is the traceback:

Exception in Tkinter callbackTraceback (most recent call last):  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1413, in __call__    return self.func(*args)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 276, in resize    self.show()  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 348, in draw    FigureCanvasAgg.draw(self)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 439, in draw    self.figure.draw(self.renderer)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper    draw(artist, renderer, *args, **kwargs)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/figure.py", line 999, in draw    func(*args)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper    draw(artist, renderer, *args, **kwargs)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/axes.py", line 2093, in draw    a.draw(renderer)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper    draw(artist, renderer, *args, **kwargs)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/text.py", line 2031, in draw    self.arrow_patch.draw(renderer)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/patches.py", line 4001, in draw    path, fillable = self.get_path_in_displaycoord()  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/patches.py", line 3949, in get_path_in_displaycoord    shrinkB=self.shrinkB * dpi_cor  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/patches.py", line 2507, in __call__    clipped_path = self._clip(path, patchA, patchB)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/patches.py", line 2452, in _clip    left, right = split_path_inout(path, insideA)  File "/home/vanderplas/PythonEnv/pydev/local/lib/python2.7/site-packages/matplotlib/bezier.py", line 242, in split_path_inout    ctl_points, command = next(path_iter)StopIteration

I'm running ubuntu with python 2.7.3, and the following:

>>> matplotlib.__version__'1.3.x'>>> matplotlib.rcParams['backend']'TkAgg'

I've seen the crash also using Agg.

@ivanov
Copy link
Member

@mdboom's change fixes Jake's example for me, but still breaks if I use two spaces instead of just one.

 plt.annotate("  ", (0, 0), (1, 0), arrowprops=dict(arrowstyle='->'))

I added a commit to deal with those, will submit PR against Mike's branch with that

mdboom added a commit that referenced this pull requestDec 17, 2012
Crash with text.usetex=True and plt.annotate
@mdboommdboom merged commit422712d intomatplotlib:v1.2.xDec 17, 2012
pelson added a commit to pelson/matplotlib that referenced this pull requestJan 9, 2014
pelson added a commit to pelson/matplotlib that referenced this pull requestJan 9, 2014
pelson added a commit to pelson/matplotlib that referenced this pull requestJan 9, 2014
pelson added a commit to pelson/matplotlib that referenced this pull requestJan 14, 2014
pelson added a commit to pelson/matplotlib that referenced this pull requestJan 14, 2014
@mdboommdboom deleted the annotate_space branchAugust 7, 2014 13:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@mdboom@ivanov

[8]ページ先頭

©2009-2025 Movatter.jp