-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
px animations does not show correctly colors if all colors are not in the first frame #2259
Comments
I think I have a similar problem. I have a dataframe with elements with different states (susceptible, infected or recovered) at different time steps. Of course at the first time step there is no recovered, but only susceptible or infected, so plotly only computes the labels based on the first time step which yields susceptible, infected but not recovered. As a result recovered are never shown. |
I am experiencing the same issue when making a choropleth. However, the problem isn't completely solved when all colors are shown in the first frame. In the following minimal example, all colors are included in the first frame, the second frame should only have a single color. As shown in the attached image, also in the second frame two colors are shown.
|
I've just updated our documentation to highlight known limitations of our animation features. The specific one that's of note here is that animations are designed to work well when each row of input is present across all animation frames, and when categorical values mapped to symbol, color and facet are constant across frames. Animations may be misleading or inconsistent if these constraints are not met. |
Are there any plans to improve this feature to make it work as expected? |
There's definitely a lot we could do to improve this feature but there are no low-hanging fruits here, and we've got nothing planned on our roadmap for the next few months related to animations. We would happily accept pull requests into the Plotly.js library that does the actual animation, or sponsorship to be able to put these features on our roadmap. |
I have the same problem but I do not know how to manage it. Is there any suggestion from your side? |
same here! |
notes - a bunch of stuff is commented out to make debugging go faster - changed how colors are handled in animate.py; now correctly matches up color timepoints with windows-- however, due to a [known bug in plotly](plotly/plotly.py#2259), colors that change across frames are not displayed correctly - when colors are assigned based on a pre-existing matrix, the colors seem to get assigned correctly. however, when clusters are assigned based on cluster values or mixture weights, it seems like colors are only assigned correctly when no lines are used (only markers). i need to look into why this is happening
Same problem here. In addition, I noticed that if a color is not present in a subsequent animation frame of x, the colors and xy values of the previous animation frame of x will be shown. |
I have the same problem. I am trying to create an animation of depth-first search where nodes are in three different colors that represent if they are not discovered, discovered but not finished, or finished. In each frame the color of a single node changes as that node goes from being not discovered to being discovered but not finished or goes from being discovered but not finished to being finished. Initially all nodes are not discovered so they are a single color. But in the next frame, as the first nodes changes color from being not discovered to being discovered but not finished, the the node disappears and is not displayed. In fact, as each nodes is discovered, it disappears from the animation and is not displayed. |
I've had the same issue when calling
|
hello @emmanuelle .
Here is the modified code. Hopefully it will help others:
|
+1 encounter the same error when coloured attribute changes over time for the datasets Even when you have all colours present in the first animation frame, when navigating through subsequent frames of data, for some record it will stack two records of data from different animation frames. |
I am facing the same problem. I have a person that got covid in a specific timestamp. My goal is to plot a scatter plot showing to the evolution of the data. The problem is that, in the beginning the person does not have covid, and, at some specific time, he gets covid. But only the label "nocovid" is being displayed in the animation, and also its data. |
+1 this bug also likely contributes to an issue I'm seeing, where In this case, the issue presents itself as points fading in and out of existence between frames, rather than moving around on the plot as expected.
|
Facing a similar issue :
Is there any way to force a redraw? |
For example
(all points are displayed with the color of continent "a"). Reported by https://community.plot.ly/t/scatter-geo-only-shows-values-with-a-certain-color-if-i-have-multiple-years-as-the-same-year/35976. Other functions such as
px.scatter
have the same problem.If all colors are used for the first frame, the problem disappears.
The text was updated successfully, but these errors were encountered: