I have two plotly express plots (one animated choropleth map and one animated barplot, see https://covid19mtl.ca/en) for which Iโd like to display the last frame (the latest date) as the default/starting value.
So far, Iโve been able to change the default slider value, but this does not update the default frame in the plot (which remains the first frame). Is there a way I can force the plot to update after setting the slider value?
After changing this plot to use a discrete colour scale, it seems this solution doesnโt work anymore. I havenโt been able to figure out the problem, other than that z no longer contains the same data.
mtlmap_fig.update_traces({
'hovertemplate': # hovertemplate str
for frame in mtlmap_fig.frames:
frame['data'][0]['hovertemplate'] = # hovertemplate str
How can I achieve the same thing (setting the default frame to be the last frame instead of the first and changing the hovertemplate) when using a discrete colourmap with px.choropleth_mapbox?