Skip to content
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

Plotly chart autoscale problem #7

Closed
craig-shenton opened this issue Apr 17, 2021 · 4 comments · Fixed by #8
Closed

Plotly chart autoscale problem #7

craig-shenton opened this issue Apr 17, 2021 · 4 comments · Fixed by #8

Comments

@craig-shenton
Copy link
Contributor

#6 Setting Plotly chart autosize=False stops chart dynamically resizing and causes issues at small page widths. But autosize=True limits chart size to 450px

@ghost
Copy link

ghost commented Apr 19, 2021

Sounds like this should have solved it back in plotly 3.8 plotly/plotly.py#1524 I wonder if using an older version will fix it...

@ghost
Copy link

ghost commented Apr 19, 2021

Hi Craig,

I am struggling to find a way to output the final webpage and recreate the plot not resizing...

  • It fails locally when I set autosize=False:
# Asthetics of the plot
fig.update_layout(
    {"plot_bgcolor": "rgba(0, 0, 0, 0)", "paper_bgcolor": "rgba(0, 0, 0, 0)"},
    autosize=False,
    height=1000,
    hovermode="x",
)

image

  • It works locally when I set autosize=True:
# Asthetics of the plot
fig.update_layout(
    {"plot_bgcolor": "rgba(0, 0, 0, 0)", "paper_bgcolor": "rgba(0, 0, 0, 0)"},
    autosize=True,
    height=1000,
    hovermode="x",
)

image

  • It also works locally when I leave autosize out:
# Asthetics of the plot
fig.update_layout(
    {"plot_bgcolor": "rgba(0, 0, 0, 0)", "paper_bgcolor": "rgba(0, 0, 0, 0)"},
    height=1000,
    hovermode="x",
)

image

fig.update_layout(
    {"plot_bgcolor": "rgba(0, 0, 0, 0)", "paper_bgcolor": "rgba(0, 0, 0, 0)"},
    autosize=True,
    margin=dict(l=50, r=50, b=50, t=50, pad=4, autoexpand=True ),
    height=1000,
    hovermode="x",
)

Really keen to get this one over the line :)

@craig-shenton
Copy link
Contributor Author

Thanks Adam the last one worked like a charm.

Craig.

@ghost
Copy link

ghost commented Apr 19, 2021

Thanks Adam the last one worked like a charm.

Craig.

No worries - it looks great now

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

Successfully merging a pull request may close this issue.

1 participant