Issue 1:
Note: I've solved this with a monkey-patch, but wanted to share anyway.

matplotlib 3.3.0, python 3.7.8 and jupyter 1.0.0

Plots wouldn't render properly as the HTML-canvas .mpl-canvas would have "undefinedpx" height and width. The culpitt is in the two lines I'll mention soon.

%matplotlib notebook

from matplotlib import pyplot

pyplot.figure(figsize=(4, 4))
pyplot.plot([1, 2, 3, 2])

I've used console.log(...) to debug and noticed entry.contentBoxSize in the code below would be a list of one item, instead that idem directly. Hence I monkey-patched a [0] in two lines in .virtualenvs/my-environment/lib/python3.7/site-packages/matplotlib/backends/web_backend/js/mpl.js as a fix.

width = entry.contentBoxSize[0].inlineSize;
height = entry.contentBoxSize[0].blockSize;

I'm clueless what exactly I've done and whether it makes sense, but it solved the problem.

I've also noticed that there's nothing similar to the code mentioned in the current head of github, so probably this will resolve itself within the next update.

I just wanted to share, in case some else runs into this issue or future-me.

This is the relevant code-snippet of matplotlib/backends/web_backend/js/mpl.js that I needed to change.

var resizeObserver = new ResizeObserver(function (entries) {
var nentries = entries.length;
for (var i = 0; i < nentries; i++) {
var entry = entries[i];
var width, height;
if (entry.contentBoxSize) {
width = entry.contentBoxSize.inlineSize;
height = entry.contentBoxSize.blockSize;
} else {
width = entry.contentRect.width;
height = entry.contentRect.height;
}

// Keep the size of the canvas and rubber band canvas in sync with
// the canvas container.
canvas.setAttribute('width', width * mpl.ratio);
canvas.setAttribute('height', height * mpl.ratio);
canvas.setAttribute(
'style',
'width: ' + width + 'px; height: ' + height + 'px;'
);

rubberband_canvas.setAttribute('width', width);
rubberband_canvas.setAttribute('height', height);

// And update the size in Python. We ignore the initial 0/0 size
// that occurs as the element is placed into the DOM, which should
// otherwise not happen due to the minimum size styling.
if (width != 0 && height != 0) {
fig.request_resize(width, height);
}
}
});

Issue 2:
Bug report

Bug summary

A simple 3D scatter plot is not working on jupyter notebook when %matplotlib notebook is enabled. However, it is working for %matplotlib inline

An extremely large, blank window appears that spans beyond the page.

Code for reproduction

%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()

Actual outcome

Expected outcome

Expecting a 3D scatter plot of A.

Matplotlib version

Operating system: posix Darwin 19.6.0

Matplotlib version: 3.3.0

Matplotlib backend (print(matplotlib.get_backend())): nbAgg

Python version: 3.7.5

Jupyter version (if applicable):

jupyter core : 4.6.3

jupyter-notebook : 6.0.3

qtconsole : 4.7.5

ipython : 7.16.1

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

Other libraries: numpy 1.19.1, scipy 1.5.2