This is a CodePen https://codepen.io/nicolaskruchten/pen/pojdmaX?editors=0010 that illustrates the issue outlined in https://community.plotly.com/t/changing-the-background-colour-of-a-graph/29246/8 and logged in Dash as https://github.com/plotly/dash/issues/1107
Edit: the newPlot behaviour is correct and the react behaviour is not.
@alexcjohnson is it intended that in the second figure straight off of newPlot that plot_bgcolor: "red" does nothing?
plot_bgcolor only applies to cartesian subplots AFAIK. All the other subplot types have their own subplot container objects (in this case scene) with their own bgcolor attributes. Might have been a good idea for these to inherit from plot_bgcolor but I think that ship has sailed.
If you add scene: {bgcolor: "green", domain: {x: [0,0.7]}} to the second layout you'll see both green and blue after react-ing from 0 to 1
OK re cartesian subplots... Does this make the current behaviour "correct" or do we agree that the blue should be cleared when I react from scatter to scatter3d ?
Oh definitely a bug
So what do you think the correct behaviour should be? on newPlot2 should there be a red background, or should the background go to white on react2?
There鈥檚 no Cartesian subplot so there should be no red, just white.
OK, so the newPlot behaviour is correct and the react behaviour is not.
Most helpful comment
OK, so the
newPlotbehaviour is correct and thereactbehaviour is not.