I am using two linked animation plots, in a similar way to that described here:
This works fine, albeit a little slow with bigger data sets. My question is whether it is possible to also plot multiple traces on one of the linked animation plots. As far as I can tell the answer is no, but I may be missing something and am interested to hear if there is a way to do this.
@harry11733, You can define more than one trace in a subplot cell to be animated.
The example you linked here has the drawback that the definition of each frame data includes attributes that are not changed from a frame to frame.
Here https://plot.ly/~empet/15012 is the above example where I included one more trace in the cell (1,1), and redefined the frames to avoid passing unnecessary info to each one.
@harry11733, To attach and display a static label to each leaf I can suggest two methods:
1. replace in trace_nodes definition
In the cell that starts with tooltip=, insert text=, textposition=, and while iterating over the tree clades append ' ' to text, and ‘top center’ to textposition as long as the leaf is not reached yet.
When you arrived to a leaf append the info you want to display to text, and an adequate textposition for that leaf ( read here about textposition https://plot.ly/python/reference/#scatter-textposition).
Perhaps you want a radial label. If this is the case, then:
2. you should extract the x, y-coordinates of the leafs from xnodes, ynodes, and attach a radial annotation following the explanation in this notebook: https://plot.ly/~empet/14803.
I do not understand the relationship between the graph and the uploaded data table (grid). I never reference the grid name while plotting and I can delete the grid on the web site and the plot still works fine. It seems the data is loaded with the plot and the plot is independent of the uploaded data grid. Why bother uploading the grid?
Can I change the rate at which frames are displayed during the playback? I would like to slow down during some parts of the simulation and then speed up again during the more boring bits.
Could you please give a minimal code you used to generate what you called online animation, without using grid data? I tried to retrieve your fig definition from Plotly cloud, but I’ve already installed Plotly 3.4.0
and it appears that you ran your code with a version < 3.4, because your slider definition generates an error during the fig retrieval.
More precisely, from Python code displayed here: https://plot.ly/~harry11733/105/#code, a slider step is defined as follows: