Issue 1:
Bug report

Bug summary

Previously working example documentation code using tight_layout() and constrained_layout now produces errors.

Code for reproduction

One of the failing codes (github link):

"""
NCL_stream_1.py
===============
This script illustrates the following concepts:
- Drawing a black-and-white streamline plot over a map

See following URLs to see the reproduced NCL plot & script:
- Original NCL script: https://www.ncl.ucar.edu/Applications/Scripts/stream_1.ncl
- Original NCL plot: https://www.ncl.ucar.edu/Applications/Images/stream_1_lg.png

Note: The streamlines generated in this plot approximate, but do not exactly
match those generated by the NCL version. This is primarily because the
seed point generation algorithm used by NCL is opaque.
"""

################################################################################
# Import packages:
import numpy as np
import xarray as xr
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import cartopy.feature as cfeature

import geocat.datafiles as gdf
from geocat.viz import util as gvutil

################################################################################
# Read in data:

# Open a netCDF data file using xarray default engine and load the data into xarrays
ds = xr.open_dataset(gdf.get('netcdf_files/uvt.nc'))
# Extract a 2D horizontal slice from the first time step of the 3D U and V variables at the bottom level
U = ds.U.isel(time=0, lev=0)
V = ds.V.isel(time=0, lev=0)

################################################################################
# Plot:

# Generate figure (set its size (width, height) in inches)
plt.figure(figsize=(16, 8))

# Generate axes using Cartopy projection
projection = ccrs.PlateCarree()
ax = plt.axes(projection=projection)

# Use global map
ax.set_global()

# Stream-plot the data
# There is no Xarray streamplot function, yet. So need to call matplotlib.streamplot directly. Not sure why, but can't
# pass xarray.DataArray objects directly: fetch NumPy arrays via 'data' attribute'
ax.streamplot(U.lon.data,
U.lat.data,
U.data,
V.data,
linewidth=1,
density=4,
color='black',
zorder=1)

# Show the plot
plt.tight_layout()
plt.show()

Actual outcome

Traceback (most recent call last):
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3417, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-32ee43073f80>", line 1, in <module>
runfile('/Users/anissaz/Desktop/GeoCAT/GeoCAT-examples/Plots/Streamlines/NCL_stream_1.py', wdir='/Users/anissaz/Desktop/GeoCAT/GeoCAT-examples/Plots/Streamlines')
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/anissaz/Desktop/GeoCAT/GeoCAT-examples/Plots/Streamlines/NCL_stream_1.py", line 64, in <module>
plt.show()
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/pyplot.py", line 337, in show
return _backend_mod.show(*args, **kwargs)
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 29, in __call__
manager.show(**kwargs)
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 113, in show
self.canvas.show()
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 68, in show
self.figure.tight_layout()
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/figure.py", line 2615, in tight_layout
pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/tight_layout.py", line 308, in get_tight_layout_figure
pad=pad, h_pad=h_pad, w_pad=w_pad)
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/tight_layout.py", line 84, in auto_adjust_subplotpars
bb += [ax.get_tightbbox(renderer, for_layout_only=True)]
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 4203, in get_tightbbox
bbox = a.get_tightbbox(renderer)
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/artist.py", line 286, in get_tightbbox
bbox = Bbox.intersection(bbox, clip_path.get_extents())
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/matplotlib/path.py", line 603, in get_extents
return Bbox([xys.min(axis=0), xys.max(axis=0)])
File "/opt/anaconda3/envs/geocat-examples/lib/python3.7/site-packages/numpy/core/_methods.py", line 43, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

Here is a link to one of our current unmerged PRs with sphinx documentation generation failures for more than just this example, if that is helpful.

Expected outcome

Used to produce the following image:

Previously working example documented with readthedocs here

Version 3.3.0 was the last version that did not experience this.

Matplotlib version

Operating system: MacOS (10.14.6)

Matplotlib version: 3.3.1

Matplotlib backend (print(matplotlib.get_backend())): module://backend_interagg

Platform version: 3.7.8

Python version: Python 3.7.8

Numpy version: 1.19.1

Xarray version: 0.16.0

Cartopy version: 0.18.0

Installed matplotlib from conda environment

Issue 2:
Bug report

Bug summary

plt.scatter() raises upon drawing when called with marker='' (no errors with 3.3.0).

This change of behavior broke seaborn.

Code for reproduction

import matplotlib.pyplot as plt
plt.scatter([], [], marker='') # fails also with plt.scatter([1,2,3], [1,2,3], marker='')
plt.show()

Actual outcome

Traceback (most recent call last):
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py", line 61, in _draw
self.figure.draw(renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/figure.py", line 1863, in draw
mimage._draw_list_compositing_images(
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 2748, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/collections.py", line 931, in draw
Collection.draw(self, renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/collections.py", line 385, in draw
extents = paths[0].get_extents(combined_transform)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/path.py", line 603, in get_extents
return Bbox([xys.min(axis=0), xys.max(axis=0)])
File "/Users/maoz/miniconda/envs/seaborn_devenv/lib/python3.8/site-packages/numpy/core/_methods.py", line 43, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity

Expected outcome

Not to fail.

Matplotlib version

Operating system: MacOS

Matplotlib version: 3.3.1

Matplotlib backend (print(matplotlib.get_backend())): MacOSX (also reproduces with %inline)

Python version: 3.8.3

Jupyter version (if applicable):

Other libraries: numpy 1.19.1

matplotlib installed through pip