Skip to content

Arrow head color fix to match arrow body #13742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2729,12 +2729,30 @@ def calc_arrow(uvw, angle=15):
# transpose to get a list of lines
heads = heads.swapaxes(0, 1)

lines = [*shafts, *heads]
# create seperate lists for lines, left arrow head lines,
# and right arrow head lines from the computed lines and
# heads to be used for generating gradients
lines = shafts
arrows1 = []
arrows2 = []
for a in range(len(heads)):
if a % 2 == 0:
arrows1.append(heads[a])
else:
arrows2.append(heads[a])
else:
arrows1 = []
arrows2 = []
lines = []

# generate 3D lines with gradient for body, left arrow head lines,
# and right arrow head lines
linec = art3d.Line3DCollection(lines, *args[argi:], **kwargs)
arrow1c = art3d.Line3DCollection(arrows1, *args[argi:], **kwargs)
arrow2c = art3d.Line3DCollection(arrows2, *args[argi:], **kwargs)
self.add_collection(linec)
self.add_collection(arrow1c)
self.add_collection(arrow2c)

self.auto_scale_xyz(XYZ[:, 0], XYZ[:, 1], XYZ[:, 2], had_data)

Expand Down