Arrow head color fix to match arrow body #13742
Closed
+19
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Tried to fix this issue by separating arrow head bodies and arrow heads to be used for generating gradient lines separately. This PR is part of coursework for CSCD01 at UTSC.
Closes #11759
Bug Description
Currently when plotting arrows using the quiver method with a gradient correctly shows a gradient for arrow bodies but not for arrow heads. Within the
quiver
method inside classAxes3D
inmpl_toolkits/mplot3d/axes3d.py
each arrow head is actually created as two lines that are at a different angle to the body of the arrow. Originally the main body lines and the lines used to generate the arrow heads are being passed together to create a singleLine3DCollection
object:This resulted in the arrow heads to have an inconsistent gradient for the plot. The fix was to create separate
Line3DCollection
for each collection of lines. Instead of one singleLine3DCollection
object to be plotted containing the body lines and then the arrow head lines, I now split it into aLine3DCollection
object for the body lines, aLine3DCollection
object for one side of the arrow heads, and aLine3DCollection
object for the other side of the arrowheads.
Example code to test
Before
After
PR Checklist