Issue 1:
Bug summary

When the figure has two columns with different numbers of rows, rows on the same side will have different heights under constrained layout.

Code for reproduction

import matplotlib.pyplot as plt
panels = [
['a', 'c'],
['a', 'c'],
['b', 'c'],
['b', 'c'],
]
fig, axes = plt.subplot_mosaic(
panels, layout = 'constrained')
fig.suptitle('Different height')
fig.canvas.draw()
print("Hieght of 'a':", axes['a'].bbox.bounds[3])
print("Hieght of 'b':", axes['b'].bbox.bounds[3])
plt.savefig('test.png')

Actual outcome

Hieght of 'a': 180.94277777777785

Hieght of 'b': 189.27677777777777

Expected outcome

Same height for 'a' and 'b'.

Additional information

No bug when axes are generated using plt.subplot or when the numbers of rows are the same for both columns. Same bug for compressed layout too.

Operating system

Ubuntu 22.04

Matplotlib Version

3.7.1

Matplotlib Backend

QtAgg

Python version

Python 3.10.6

Jupyter version

No response

Installation

pip

Issue 2:
Bug report

Bug summary

When following the documentation on plotting categorical variables the plots do not render. Instead various errors are thrown about converting strings to floats.

Code for reproduction

import matplotlib.pyplot as plt

data = {'apples': 10, 'oranges': 15, 'lemons': 5, 'limes': 20}
names = list(data.keys())
values = list(data.values())

fig, axs = plt.subplots(1, 3, figsize=(9, 3), sharey=True)
axs[0].bar(names, values)
axs[1].scatter(names, values)
axs[2].plot(names, values)
fig.suptitle('Categorical Plotting')

Actual outcome

---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-32-c50911b594df> in <module>()
4
5 fig, axs = plt.subplots(1, 3, figsize=(9, 3), sharey=True)
----> 6 axs[0].bar(names, values)
7 axs[1].scatter(names, values)
8 axs[2].plot(names, values)

/Users/kevin.thompson/venv3/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax, *args, **kwargs)
1896 warnings.warn(msg % (label_namer, func.__name__),
1897 RuntimeWarning, stacklevel=2)
-> 1898 return func(ax, *args, **kwargs)
1899 pre_doc = inner.__doc__
1900 if pre_doc is None:

/Users/kevin.thompson/venv3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in bar(self, left, height, width, bottom, **kwargs)
2103 if align == 'center':
2104 if orientation == 'vertical':
-> 2105 left = [left[i] - width[i] / 2. for i in xrange(len(left))]
2106 elif orientation == 'horizontal':
2107 bottom = [bottom[i] - height[i] / 2.

/Users/kevin.thompson/venv3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in <listcomp>(.0)
2103 if align == 'center':
2104 if orientation == 'vertical':
-> 2105 left = [left[i] - width[i] / 2. for i in xrange(len(left))]
2106 elif orientation == 'horizontal':
2107 bottom = [bottom[i] - height[i] / 2.

TypeError: unsupported operand type(s) for -: 'str' and 'float'

Expected outcome

I expected it to render the pretty pictures found in the documentation I was trying to duplicate

Matplotlib version

Operating System: OSX 10.11.6 (El Capitan)

Matplotlib Version: 2.0.2

Python Version: 3.6.0

Jupyter Version (if applicable): 4.3.0

Installed via pip in a virtualenv