<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>

<p dir="auto">When plotting with <code class="notranslate">%matplotlib notebook</code>, the canvas gets cropped to a small section in the top left corner.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<p dir="auto">When running the following code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots()
ax.scatter(range(10), range(10))"><pre class="notranslate"><span class="pl-c1">%</span><span class="pl-s1">matplotlib</span> <span class="pl-s1">notebook</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>()
<span class="pl-s1">ax</span>.<span class="pl-en">scatter</span>(<span class="pl-en">range</span>(<span class="pl-c1">10</span>), <span class="pl-en">range</span>(<span class="pl-c1">10</span>))</pre></div>
<p dir="auto">I get the following output in <strong>Chrome</strong>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/ad4b056b3c2275c5cd7ca7f02058dba6fa21b5b8028bd7e5968bd8bd4624e613/68747470733a2f2f692e696d6775722e636f6d2f636552354536612e706e67"><img src="https://camo.githubusercontent.com/ad4b056b3c2275c5cd7ca7f02058dba6fa21b5b8028bd7e5968bd8bd4624e613/68747470733a2f2f692e696d6775722e636f6d2f636552354536612e706e67" alt="https://i.imgur.com/ceR5E6a.png" data-canonical-src="https://i.imgur.com/ceR5E6a.png" style="max-width: 100%;"></a></p>
<p dir="auto">As you can see, the interactive plot is cropped to the top left corner. Inspecting the HTML shows that the height and width are <code class="notranslate">undefined</code>. Therefore, chrome defaults to the size 300 x 150</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;canvas
  class=&quot;mpl-canvas&quot;
  style=&quot;width: undefinedpx; height: undefinedpx;&quot;
  width=&quot;NaN&quot;
  height=&quot;NaN&quot;&gt;
&lt;/canvas&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">canvas</span>
  <span class="pl-c1">class</span>="<span class="pl-s">mpl-canvas</span>"
  <span class="pl-c1">style</span>="<span class="pl-s">width: undefinedpx; height: undefinedpx;</span>"
  <span class="pl-c1">width</span>="<span class="pl-s">NaN</span>"
  <span class="pl-c1">height</span>="<span class="pl-s">NaN</span>"<span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">canvas</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/3aed4051c06578d1eedbc234d8864d9cb13325e6c2d0d4cce1f562a8ab030e31/68747470733a2f2f692e696d6775722e636f6d2f545170757a4a542e706e67"><img src="https://camo.githubusercontent.com/3aed4051c06578d1eedbc234d8864d9cb13325e6c2d0d4cce1f562a8ab030e31/68747470733a2f2f692e696d6775722e636f6d2f545170757a4a542e706e67" alt="https://i.imgur.com/TQpuzJT.png" data-canonical-src="https://i.imgur.com/TQpuzJT.png" style="max-width: 100%;"></a></p>
<p dir="auto">Closing the tab and rerunning in <strong>Firefox</strong>, I get no issues.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/372f87ad39b56b56326df9a69c6ac8bef7a2508d436e6dbd836e98375e29715c/68747470733a2f2f692e696d6775722e636f6d2f4e6478594138682e706e67"><img src="https://camo.githubusercontent.com/372f87ad39b56b56326df9a69c6ac8bef7a2508d436e6dbd836e98375e29715c/68747470733a2f2f692e696d6775722e636f6d2f4e6478594138682e706e67" alt="https://i.imgur.com/NdxYA8h.png" data-canonical-src="https://i.imgur.com/NdxYA8h.png" style="max-width: 100%;"></a></p>
<br>
<p dir="auto">The shrunk canvas is still interactive (you can still pan the y-axis up and down), but obviously the height and width calculations went awry. I have tried restarting the Jupyter server (and the notebook kernel) and I still get the same result in Chrome.</p>
<p dir="auto"><strong>Note</strong>: using <code class="notranslate">%matplotlib inline</code> works fine in Chrome.</p>
<p dir="auto">To summarize, I only get this issue when I use <strong><code class="notranslate">%matplotlib notebook</code></strong> in <strong>Chrome</strong>. I don't know if switching to Windows would resolve this problem (I use Ubuntu 20.04).</p>
<p dir="auto"><strong>Versions</strong></p>
<p dir="auto">I am running Jupyter in a virtual environment managed by Poetry.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="% lsb_release -d
Description:	Ubuntu 20.04.1 LTS

% poetry run jupyter --version
jupyter core     : 4.6.3
jupyter-notebook : 6.1.1
qtconsole        : 4.7.5
ipython          : 7.17.0
ipykernel        : 5.3.4
jupyter client   : 6.1.6
jupyter lab      : not installed
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.7
traitlets        : 4.3.3

% poetry run python -c 'import matplotlib; print(matplotlib.get_backend())'
TkAgg

% poetry run python -V
Python 3.8.3

% google-chrome --version
Google Chrome 84.0.4147.105

% cat pyproject.toml
...

[tool.poetry.dependencies]
python = &quot;^3.8&quot;
jupyter = &quot;^1.0.0&quot;
pandas = &quot;^1.1.0&quot;
numpy = &quot;^1.19.1&quot;
scipy = &quot;^1.5.2&quot;
networkx = &quot;^2.4&quot;
ipywidgets = &quot;^7.5.1&quot;
matplotlib = &quot;^3.3.0&quot;
sklearn = &quot;^0.0&quot;

..."><pre class="notranslate"><code class="notranslate">% lsb_release -d
Description:	Ubuntu 20.04.1 LTS

% poetry run jupyter --version
jupyter core     : 4.6.3
jupyter-notebook : 6.1.1
qtconsole        : 4.7.5
ipython          : 7.17.0
ipykernel        : 5.3.4
jupyter client   : 6.1.6
jupyter lab      : not installed
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.7
traitlets        : 4.3.3

% poetry run python -c 'import matplotlib; print(matplotlib.get_backend())'
TkAgg

% poetry run python -V
Python 3.8.3

% google-chrome --version
Google Chrome 84.0.4147.105

% cat pyproject.toml
...

[tool.poetry.dependencies]
python = "^3.8"
jupyter = "^1.0.0"
pandas = "^1.1.0"
numpy = "^1.19.1"
scipy = "^1.5.2"
networkx = "^2.4"
ipywidgets = "^7.5.1"
matplotlib = "^3.3.0"
sklearn = "^0.0"

...
</code></pre></div>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">A simple 3D scatter plot is not working on jupyter notebook when <code class="notranslate">%matplotlib notebook</code> is enabled. However, it is working for <code class="notranslate">%matplotlib inline</code></p>

<p dir="auto">An extremely large, blank window appears that spans beyond the page.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="%matplotlib notebook

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

A = np.random.random((100,3))
fig = plt.figure()
ax = Axes3D(fig)
ax.scatter(A[:,0], A[:,1], A[:,2])
plt.show()"><pre class="notranslate"><span class="pl-c1">%</span><span class="pl-s1">matplotlib</span> <span class="pl-s1">notebook</span>

<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">from</span> <span class="pl-s1">mpl_toolkits</span>.<span class="pl-s1">mplot3d</span> <span class="pl-k">import</span> <span class="pl-v">Axes3D</span>

<span class="pl-v">A</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>((<span class="pl-c1">100</span>,<span class="pl-c1">3</span>))
<span class="pl-s1">fig</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
<span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-v">Axes3D</span>(<span class="pl-s1">fig</span>)
<span class="pl-s1">ax</span>.<span class="pl-en">scatter</span>(<span class="pl-v">A</span>[:,<span class="pl-c1">0</span>], <span class="pl-v">A</span>[:,<span class="pl-c1">1</span>], <span class="pl-v">A</span>[:,<span class="pl-c1">2</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto"><strong>Actual outcome</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/f3db3afac0a2629303b342241b9e2f53900bb6befb602fbd010887bf0e697b3d/68747470733a2f2f692e706f7374696d672e63632f335271516a7934662f53637265656e2d53686f742d323032302d30372d33302d61742d392d34342d35312d504d2e706e67"><img src="https://camo.githubusercontent.com/f3db3afac0a2629303b342241b9e2f53900bb6befb602fbd010887bf0e697b3d/68747470733a2f2f692e706f7374696d672e63632f335271516a7934662f53637265656e2d53686f742d323032302d30372d33302d61742d392d34342d35312d504d2e706e67" alt="Fail case" data-canonical-src="https://i.postimg.cc/3RqQjy4f/Screen-Shot-2020-07-30-at-9-44-51-PM.png" style="max-width: 100%;"></a></p>

<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">Expecting a 3D scatter plot of <code class="notranslate">A</code>.</p>


<p dir="auto"><strong>Matplotlib version</strong></p>

<ul dir="auto">
<li>Operating system: posix Darwin 19.6.0</li>
<li>Matplotlib version: 3.3.0</li>
<li>Matplotlib backend (<code class="notranslate">print(matplotlib.get_backend())</code>): nbAgg</li>
<li>Python version: 3.7.5</li>
<li>Jupyter version (if applicable):
<ul dir="auto">
<li>jupyter core     : 4.6.3</li>
<li>jupyter-notebook : 6.0.3</li>
<li>qtconsole        : 4.7.5</li>
<li>ipython          : 7.16.1</li>
<li>ipykernel        : 5.3.4</li>
<li>jupyter client   : 6.1.6</li>
<li>jupyter lab      : not installed</li>
<li>nbconvert        : 5.6.1</li>
<li>ipywidgets       : 7.5.1</li>
<li>nbformat         : 5.0.7</li>
<li>traitlets        : 4.3.3</li>
</ul>
</li>
<li>Other libraries: numpy 1.19.1, scipy 1.5.2</li>
</ul>