Skip to content

Plotly.react sequence and subplot bgcolor #2509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolaskruchten opened this issue Mar 29, 2018 · 2 comments
Closed

Plotly.react sequence and subplot bgcolor #2509

nicolaskruchten opened this issue Mar 29, 2018 · 2 comments
Labels
bug something broken

Comments

@nicolaskruchten
Copy link
Contributor

The following Pen shows a simple pair of calls to Plotly.react which causes the plot_bgcolor to be applied to the gridlines of one of the subplots instead of its background: https://codepen.io/nicolaskruchten/pen/QmQXMK

@alexcjohnson alexcjohnson added the bug something broken label Mar 29, 2018
@alexcjohnson
Copy link
Collaborator

Alright, this one isn't as bad as it looks... the grid actually is supposed to be this color (which is a slightly darkened version of the red background), since we blend plot_bgcolor with the default line color in order to avoid unnecessary opacity. The problem is just that we're not creating the right background rect for the new subplot.

@alexcjohnson
Copy link
Collaborator

And yes, happens with relayout as well:

Plotly.newPlot(gd,
  [{x:[1],y:[2]},{x:[3],y:[4],xaxis:'x2',yaxis:'y2'}],
  {xaxis2:{overlaying:'x'},yaxis2:{overlaying:'y'},plot_bgcolor:'red'}
)
Plotly.relayout(gd,{
  'xaxis.domain':[0, 0.4],
  'xaxis2.domain':[0.6,1],
  'xaxis2.overlaying':null
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants