You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
annotation connectionstyle and width, headwidth compatibility issue #14195
This code snipet works fine. However, if I change connectionstyle to "angle,angleA=-90,angleB=10,rad=5", it just does not work. Not sure what is wrong.
Traceback (most recent call last):
File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_qt5.py", line 501, in _draw_idle
self.draw()
File "/Users/jklymak/matplotlib/lib/matplotlib/backends/backend_agg.py", line 388, in draw
self.figure.draw(self.renderer)
File "/Users/jklymak/matplotlib/lib/matplotlib/artist.py", line 38, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/jklymak/matplotlib/lib/matplotlib/figure.py", line 1716, in draw
renderer, self, artists, self.suppressComposite)
File "/Users/jklymak/matplotlib/lib/matplotlib/image.py", line 135, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/jklymak/matplotlib/lib/matplotlib/artist.py", line 38, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/jklymak/matplotlib/lib/matplotlib/axes/_base.py", line 2670, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "/Users/jklymak/matplotlib/lib/matplotlib/image.py", line 135, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/jklymak/matplotlib/lib/matplotlib/artist.py", line 38, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/jklymak/matplotlib/lib/matplotlib/text.py", line 2369, in draw
self.arrow_patch.draw(renderer)
File "/Users/jklymak/matplotlib/lib/matplotlib/patches.py", line 4303, in draw
path, fillable = self.get_path_in_displaycoord()
File "/Users/jklymak/matplotlib/lib/matplotlib/patches.py", line 4287, in get_path_in_displaycoord
self.get_mutation_aspect())
File "/Users/jklymak/matplotlib/lib/matplotlib/patches.py", line 3250, in __call__
return self.transmute(path, mutation_size, linewidth)
File "/Users/jklymak/matplotlib/lib/matplotlib/patches.py", line 3717, in transmute
x0, y0, x1, y1, x2, y2 = self.ensure_quadratic_bezier(path)
File "/Users/jklymak/matplotlib/lib/matplotlib/patches.py", line 3202, in ensure_quadratic_bezier
"'path' is not a valid quadratic Bezier curve")
ValueError: 'path' is not a valid quadratic Bezier curve
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
I think that this is actually correct that it is unable to work and should raise, however I think the work is to make the error message more understandable (and potentially erroring before draw is called, but that is less necessary). While "not a valid quadratic Bezier curve" is at least in some sense accurate and the proximal cause of the incompatibility, it is not useful to a user who asked for an arrow to be drawn.
The short version is that the default arrow style is "simple", which can only work with a subset of connection styles, such as arc3 or angle3.
Setting the arrow style to e.g. -> (or pretty much any of the more pictoral keys, i.e. all except "simple", "fancy", or "wedge") will fix it.
The annotate docstring for the arrowprops arg gets at this behavior by saying:
For historical reasons there are two different ways to specify arrows, "simple" and "fancy":
Simple arrow:
If arrowprops does not contain the key 'arrowstyle' the allowed keys are:
<table removed for brevity, but notably "connectionstyle" is absent>
...
Fancy arrow:
This is used if 'arrowstyle' is provided in the arrowprops.
<table removed for brevity, but notably "connectionstyle" is present>
Technically, there are some options for "connectionstyle" that will work, and they do still get passed through to FancyArrowPatch so not sure disallowing it fully would be advisable.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
jklymak commentedon May 12, 2019
github-actions commentedon Jun 16, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
ksunden commentedon Jun 16, 2023
I think that this is actually correct that it is unable to work and should raise, however I think the work is to make the error message more understandable (and potentially erroring before draw is called, but that is less necessary). While "not a valid quadratic Bezier curve" is at least in some sense accurate and the proximal cause of the incompatibility, it is not useful to a user who asked for an arrow to be drawn.
The short version is that the default arrow style is
"simple", which can only work with a subset of connection styles, such asarc3orangle3.Setting the arrow style to e.g.
->(or pretty much any of the more pictoral keys, i.e. all except "simple", "fancy", or "wedge") will fix it.The
annotatedocstring for the arrowprops arg gets at this behavior by saying:Technically, there are some options for "connectionstyle" that will work, and they do still get passed through to
FancyArrowPatchso not sure disallowing it fully would be advisable.github-actions commentedon Sep 1, 2025
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
timhoffm commentedon Sep 2, 2025
The updated docstring that @ksunden mentions has been added in #21743, so after this issue was created. I consider the issue solved through that PR.