You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Colab output cell grows unbounded blank space after a Plotly figure — regression starting in plotly.py 7.0.0 #5717
Colab output cell grows unbounded blank space after a Plotly chart — regression in plotly.py 7.0.0
Summary
In Google Colab, a code cell that calls fig.show() (via plotly.express or plotly.graph_objects) causes that cell's output container to grow to an enormous height, filled with blank space far beyond the actual chart. Scrolling through the output makes the blank area grow further, making it effectively impossible to scroll past it to reach output below. This does not happen with print() or display() — only with Plotly's fig.show().
Bisecting plotly versions (full runtime restart between each test, everything else held constant) isolates this to a regression introduced in plotly.py 7.0.0:
plotly version
Result
6.7.0
Clean
6.8.0
Clean
6.9.0
Clean
7.0.0
Reproduces the bug
Environment
Google Colab (colab.research.google.com), hosted runtime
Python 3.13 (Colab default runtime)
plotly installed via pip install plotly --upgrade (no version pin)
Reproduction status
This reproduces reliably in a large, complex private notebook (many cells, many prior fig.show() calls before the affected one). It does not reproduce in a minimal single-chart notebook — we tried the snippet below in a fresh Colab notebook under plotly==7.0.0 and saw no issue:
So whatever triggers this needs more than just "a fig.show() call on 7.0.0" — something about a larger/more complex notebook context matters, and we haven't isolated what. Flagging this rather than claiming a working minimal repro.
Suspected root cause
Comparing fig.to_html() output between plotly 6.9.0 and 7.0.0 for the same figure, two changes stand out in the generated HTML's <head>:
A <!doctype html> declaration was added (switches the embedded iframe document from quirks mode to standards mode).
A new inline style was added: <style>html, body {height: 100%;}</style>.
Forcing height: 100% inside a document that's embedded in an iframe which Colab is itself auto-sizing to fit that content creates a circular sizing dependency — the inner document claims 100% of its container's height while the outer container is sizing itself to the inner content. A resize or intersection event (like scrolling) can force recomputation of both with no stable convergence point, which matches the observed behavior (blank space that grows the more you scroll).
Hi @techno-phile, thanks for the report. As you mentioned I'm not able to reproduce the issue in a blank notebook (though I do see a larger-than-expected amount of blank space under the figure). If you're able to share a notebook which reliably reproduces the issue, that would be very helpful.
Could you try replacing fig.show() with fig.show(renderer="notebook") and let us know if you see the same issue? If that resolves the problem, I have an idea of what needs to be fixed.
Thanks @techno-phile for confirming! I believe the draft PR I linked above will fix the issue in that case; I'll finalize that PR and get it merged.
I've verified the fix on my end by building a .whl and installing it in Colab; it resolves the extra-space problem I'm seeing so I suspect it will resolve your issue as well. If you'd be willing to verify the fix on your end by following the same steps, that would be helpful as additional confirmation, but I realize it's a bit of a pain.
Just putting a few screenshots here, even though I can't reproduce the infinitely-growing issue, I do see a bunch of extra space underneath the plot which is not present with 6.9.0 but appears with 7.0.0:
The extra space keeps on increasing if there are multiple fig.show in a cell till the cell gets to its max pxl size. the real output is small but the space gets enormous.
is there anything you want me to do? fig.show(renderer="notebook") fixed it on my side.
Activity
emilykl commentedon Sep 3, 2026
Hi @techno-phile, thanks for the report. As you mentioned I'm not able to reproduce the issue in a blank notebook (though I do see a larger-than-expected amount of blank space under the figure). If you're able to share a notebook which reliably reproduces the issue, that would be very helpful.
Could you try replacing
fig.show()withfig.show(renderer="notebook")and let us know if you see the same issue? If that resolves the problem, I have an idea of what needs to be fixed.techno-phile commentedon Sep 3, 2026
yes fig.show(renderer="notebook") resolved the issue.
thank you Emily.
emilykl commentedon Sep 3, 2026
Thanks @techno-phile for confirming! I believe the draft PR I linked above will fix the issue in that case; I'll finalize that PR and get it merged.
I've verified the fix on my end by building a
.whland installing it in Colab; it resolves the extra-space problem I'm seeing so I suspect it will resolve your issue as well. If you'd be willing to verify the fix on your end by following the same steps, that would be helpful as additional confirmation, but I realize it's a bit of a pain.emilykl commentedon Sep 3, 2026
Just putting a few screenshots here, even though I can't reproduce the infinitely-growing issue, I do see a bunch of extra space underneath the plot which is not present with 6.9.0 but appears with 7.0.0:
v6.9.0

v7.0.0

techno-phile commentedon Sep 4, 2026
The extra space keeps on increasing if there are multiple fig.show in a cell till the cell gets to its max pxl size. the real output is small but the space gets enormous.
is there anything you want me to do? fig.show(renderer="notebook") fixed it on my side.
emilykl commentedon Sep 4, 2026
@techno-phile No, you're good! The PR above is merged so the fix will be included in the next plotly release, should be within a few weeks from now.