plotly / plotly_express

Plotly Express - Simple syntax for complex charts. Now integrated into plotly.py!
https://plot.ly/python/plotly-express/
MIT License
4 stars 0 forks source link

Marginal subplots disappear when selecting another frame #159

Open juanmah opened 4 years ago

juanmah commented 4 years ago

I have a plotly express graph with marginal subplots and animation frame:

fig = px.scatter(
    timeseries_heating,
    x="air_temperature",
    y="heating_degree_hours_",
    color="meter",
    animation_frame="base_temperature",    
    opacity=0.7,
    marginal_x="violin",
    marginal_y="violin",
    hover_name="building_id",
    category_orders=category_orders,
    color_discrete_map=color_discrete_map_meter,
)
fig.show()

It is displayed well:

newplot

When I play the animation or I change the frame, the subplots disappear:

Captura de pantalla de 2019-11-13 07-19-14

If I double click on the subplots, they reappear. When I export the image, the subplots are drawed.

You can see this behaviour in: https://www.kaggle.com/juanmah/ashrae-degree-hours

Plot.ly version : '4.2.1'

jeslinmx commented 2 years ago

+1 I am able to reproduce this error in plotly 5.5.0, using renderer "browser".

Before moving animation slider:

image

After moving:

image

Looking at fig.frames, I can see that all the marginal plots exist in the Figure object (5 * 24 = 120 box plots, and 120 histograms:

image

image

So this maybe an issue with the renderer. Indeed, when I check the javascript console, there are some warnings logged which may provide a hint:

127.0.0.1-1641876947892.log

The first two were logged upon moving the slider, and the next two were logged upon the resize event which triggered when I opened the console. Serendipitously, the resize also caused the missing marginal plots to reappear.

image

I'm not too sure if this issue should be reported to the plotly.js repo instead, as I don't have a deep enough understanding of plotly to tell if the problem lies in rendering or in plotly-express generating a graph object which violates some known expectations.