-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add arrow curvature to sources and monitors with bend radius (#272)
Curved arrows are only possible through FancyArrowPatch, but those define the arrow head size in display coordinates and end points in data coordinates. Furthermore, the arrow head is included in the total length, as opposed to what happens with Axes.arrow, that was used before. The result is that the arrow length calculated based on the axes limits or simulation boundaries can end up too small for the arrow head (and for visualization as well). The solution here, which might actually be preferable even without the bending, is to define the arrow size in real units (inches, following matplotlib's DPI setting) so that the arrows are always the same size. That can only be accomplished by waiting for the transformations to be set, at drawing time, so we use a `draw_event` callback to calculate the arrow shape. If the drawing window is resized, the arrow length will change, though, because the callback is only called once (to avoid the danger of inifite loops). Signed-off-by: Lucas Heitzmann Gabrielli <[email protected]>
- Loading branch information
1 parent
d064762
commit df008ef
Showing
5 changed files
with
113 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.