-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
Seperated arrow head bodies and arrow heads to be used for generating gradient lines seperately.
Seperated arrow head bodies and arrow heads to be used for generating gradient lines seperately.
Thanks for going forward with trying to solve this issue. The problem with using three line collections is that the return value of Not really sure, what the right way to go is:
Maybe other devs have more ideas. |
Thanks for looking at my solution. What about also having a single line collection of all the lines that can be used just for returning purposes? This would essentially be the same as what was being done before. |
That's basically my first bullet point. Since you have Note that it will be a bit tricky to implement this correctly. Color-replication should only be done if there are multiple colors - i.e. not if e.g. Note also, that the same problem will arise for other arguments, e.g. |
This looked on the right track... |
This PR is stale and the issue has been addressed by #27754, so closing this one. |
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