8000 Included an option to normalize · matplotlib/matplotlib@ff2a207 · GitHub
[go: up one dir, main page]

Skip to content

Commit ff2a207

Browse files
committed
Included an option to normalize
1 parent a204ae0 commit ff2a207

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,6 +2543,8 @@ def calc_arrow(uvw, angle=15):
25432543
arrow_length_ratio = kwargs.pop('arrow_length_ratio', 0.3)
25442544
# pivot point
25452545
pivot = kwargs.pop('pivot', 'tail')
2546+
# normalize
2547+
pivot = kwargs.pop('normalize', False)
25462548

25472549
# handle args
25482550
argi = 6
@@ -2603,7 +2605,10 @@ def calc_arrow(uvw, angle=15):
26032605
# If any row of UVW is all zeros, don't make a quiver for it
26042606
mask = norm > 1e-10
26052607
XYZ = XYZ[mask]
2606-
UVW = UVW[mask]
2608+
if normalize == True:
2609+
UVW = UVW[mask]/ norm[mask].reshape((-1, 1))
2610+
else:
2611+
UVW = UVW[mask]
26072612

26082613
if len(XYZ) > 0:
26092614
# compute the shaft lines all at once with an outer product

0 commit comments

Comments
 (0)
0