-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Cones color issue #2827
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
The Cone trace with vector norms colormapped to a colorscale is destinated mainly for plotting physical (differentiable) vector fields. The Their definition can be read here: https://github.com/plotly/plotly.js/blob/master/src/traces/cone/attributes.js#L107.
It's not clear what are two consecutive positions. Two positions having consecutive indices in the x, y, z arrays or two consecutive positions in space (but what really two consecutive positions in space mean?). Here is a Jupyter Notebook, edited in May 2018, when Cone trace was introduced (Plotly version 2.7), and updated today using new Plotly style. All vector fields from the above notebook are colormapped in concordance with their norms (no odd color assigned as in your second plot). This makes me think that in your second case plotly.js couldn't derive correctly that internal factor, because your vectors are just some vectors placed somewhere in space, and no two vectors can be considered consecutive in space. In your first example you have two groups of vectors some at x=0 and others at x=0.5, and perhaps the two groups have been interpreted as "consecutive". The internally computed factor was also discussed in this plotly.js issue plotly/plotly.js#3613. Hence if you only played with this trace and noticed the reported issue, but you are interested in plotting a vector field whose vectors seem to follow a trajectory as in the examples from the above notebook, then you can try plot it and give a feedback here. |
@empet Thank you for this insight! I will have a look at the discussed issue you mention. I just tried something by adding an extra cube along the y- or z-directions and the issue remains the same. However, if I add one along both directions then it works as expected. |
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson |
I am having a small issue when plotting cones with Plotly (offline). In my data, I have 2 types of vectors for norm 1 and 1.5. When I plot just 8 of them on a cube, the colors are rendered very well with each type of vector have one of two colors. But as soon as I go bigger with 2 cubes for example then it becomes quite random. Here is a minimal example that reproduces this issue.
The data:
Plotting 1 cube:
The figure displays the correct color for the 8 vectors.
Plotting 2 cubes:
As you can see on this last image, all vectors of norm 1 are dark purple, whereas the vectors of norm 1.5 take a gradient of colors with some even being dark purple as shown by the cone that has its coordinates displayed.
Does anyone know how to solve this issue?
The text was updated successfully, but these errors were encountered: