Plotly Express Animation w/ Box Plots?

I am able to create an animation of different groups within a Dataframes as a scatter graph (plotly express/jupyter lab),

e.g.
px.scatter(df x="group", y="range", color = "group", animation_frame = "date", animation_group = "group")

but when I change the type of plot from scatter to box or bar, only one out of 10 “groups” shows up in the graph–is there something different I need to add for other graph type animations?

Are you able to post some sample data that shows what you’re seeing? It’s a bit hard to understand the problem you’re describing…

Sure @nicolaskruchten ! The actual data is available here, but the df that I’m speaking to looks something like this:

bay | date | temp
201 1-1-2018 30
202 1-1-2018 23
203 1-1-2018 12
204 1-1-2018 11
205 1-1-2018 21
206 1-1-2018 22
207 1-1-2018 32
208 1-1-2018 43
209 1-1-2018 32
210 1-1-2018 33

where there are 10 different “bays” which record temperature several times a day (meaning that there are several temperatures per date per bay over 115 days). I’m trying to show an animated box plot that shows the distribution of temperatures over each date because they change significantly in each bay over the time period.

If my Dataframes is df, doing this:

px.box(df_env, x="bay", y="temp", color = "bay", 
       animation_frame = "date", 
       animation_group = "bay", 
       range_y = [15, 85],
       range_x = [200, 211])

results in an animation of only one “bay,” although using the same code as a scatter shows an animation of all of the bay temperatures changing over each date. Are there additional parameters that I need to define for non-scatter animations?

Hmm ok there’s not enough data here for me to replicate your problem I think… With the built-in data you can run this:

import plotly_express as px
gapminder = px.data.gapminder()
px.box(gapminder, x="continent", y="lifeExp", animation_frame="year")

and get this, which looks about as expected…

Perhaps there’s something odd about your particular data?

Hi @nicolaskruchten
Here are a couple screenshots of my basic box plots and the csv file that I’m using as df_env is in the link in my previous comment. As you can see in the first plot, I can plot all of the data as box plots, however, when I add in the animation, only one of the “bay” groups appears. Any ideas on why this is occurring?

OK what happens if you query specifically week 46: is there data there for all bays within that 15-85 temperature range?