Skip to content

Commit 1f110b9

Browse files
committed
arrow lengths are scaled consistently regardless of direction and aspect ratio (ax.set_aspect()). This fixes issue #2575.
1 parent 68fc687 commit 1f110b9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
- Arrow lengths are now scaled consistently in the X and Y directions,
12+
and their lengths no longer exceed the height of the plot window.
13+
1014
## [2.9.0rc1] - 2025-06-10
1115

1216
### Added

tidy3d/components/geometry/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,9 @@ def _cb(event):
22922292
event.canvas.mpl_disconnect(arrow.set_shape_cb[0])
22932293

22942294
transform = arrow.axes.transData.transform
2295-
scale = transform((1, 0))[0] - transform((0, 0))[0]
2295+
scale_x = transform((1, 0))[0] - transform((0, 0))[0]
2296+
scale_y = transform((0, 1))[1] - transform((0, 0))[1]
2297+
scale = max(scale_x, scale_y) # <-- Hack: This is a somewhat arbitrary choice.
22962298
arrow_length = ARROW_LENGTH * event.canvas.figure.get_dpi() / scale
22972299

22982300
if bend_radius:

0 commit comments

Comments
 (0)