-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
a more user-friendly way to specify color for each arrow in 3D quiver? #8484
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
Comments
See this gist for an example of specifying custom colors for each arrow. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
Incidentally, this issue is not present in much older versions of matplotlib, as seen in examples like https://github.com/pdebuyl/compute/blob/master/hilbert_curve/hilbert_curve.ipynb (version with images: http://pdebuyl.be/blog/2015/hilbert-curve.html) Still happening in 3.6.x (or any version before 3.8.4) |
Does #27754 fix this issue? |
I think so. Everybody, please report back if you think something is missing. |
Great to see it finally fixed 🥳 |
I wanted to visualize better the generated 3D quiver plot by specifiing a custom color for each arrow as follows:
vector3d(x, y, z) -> rgb(x/x_max, y/y_max, z/z_max) where all values are absolute values
After browsing the doc, I came across the
colors
argument which is passed toLineCollection
.After some trial and error, I finally figured out the logic of how the plot is actually drawn:
For those who may be interested, for my case I have used the following functions as a work around to transform the list of rgb colors for each arrow to the corresponding list which correctly colored the 3D quiver plot:
My question is: shouldn't it be more user-friendly to just specify a color for each arrow regardless of its length(a.k.a. whether it will actually be drawn)? I suppose the similar problem also exists for customizing other properties like line width.
Matplotlib version
tested with matplotlib 2.0.0, python 2.7 on windows 7 x64 and ubuntu 16.04 x64
The text was updated successfully, but these errors were encountered: