Skip to content

Commit c13a5a7

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 c13a5a7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10-
## [2.9.0rc1] - 2025-06-10
10+
## [2.9.0rc1] - 2025-06-16
1111

1212
### Added
1313

@@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636
- Validation for `CustomGridBoundaries`, which was previously allowing unsorted arrays and arrays with less than two entries.
3737
- `DiffractionMonitor` results to apply finite grid field corrections for higher precision when comparing e.g. to `FluxMonitor` computations of total power.
3838
- Bug when validating the grid resolution near `CoaxialLumpedPort`.
39+
- Arrow lengths are now scaled consistently in the X and Y directions,
40+
and their lengths no longer exceed the height of the plot window.
3941

4042
### Changed
4143
- Relaxed bounds checking of path integrals during `WavePort` validation.

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)