Issue 1:
Bug report

When creating a legend with a pie graph using the GTK3Cairo backend a TypeError is raised. The issue affects versions 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2 but not 2.2.3. Likewise this exception is not raised with the backend is GTK3Agg.

Code for reproduction

import matplotlib
matplotlib.rcParams['backend'] = 'GTK3Cairo'
import matplotlib.pyplot as plt

fig1, ax1 = plt.subplots()
ax1.pie(
(83, 14, 2),
colors=(
(0.75, 0.86, 1.0),
(0.49, 0.61, 0.73),
(0.24, 0.36, 0.47)
)
)
legend_bbox = fig1.legend(['Sample Text'])
legend_bbox.legendPatch.set_linewidth(0)
plt.show()

Actual outcome

Traceback (most recent call last):
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3cairo.py", line 33, in on_draw_event
self._render_figure(allocation.width, allocation.height)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3cairo.py", line 21, in _render_figure
self.figure.draw(self._renderer)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/figure.py", line 1649, in draw
renderer, self, artists, self.suppressComposite)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/legend.py", line 646, in draw
self.legendPatch.draw(renderer)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/patches.py", line 535, in draw
renderer.draw_path(gc, tpath, affine, rgbFace)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_cairo.py", line 239, in draw_path
_append_path(ctx, path, transform, clip)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_cairo.py", line 163, in _append_path
return _append_paths(ctx, [path], [transform], clip)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_cairo.py", line 104, in _append_paths_slow
*np.concatenate([cur / 3 + points[:2] * 2 / 3,
TypeError: unsupported operand type(s) for /: 'tuple' and 'int'
Traceback (most recent call last):
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3cairo.py", line 33, in on_draw_event
self._render_figure(allocation.width, allocation.height)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_gtk3cairo.py", line 21, in _render_figure
self.figure.draw(self._renderer)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/figure.py", line 1649, in draw
renderer, self, artists, self.suppressComposite)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/legend.py", line 646, in draw
self.legendPatch.draw(renderer)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/patches.py", line 535, in draw
renderer.draw_path(gc, tpath, affine, rgbFace)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_cairo.py", line 239, in draw_path
_append_path(ctx, path, transform, clip)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_cairo.py", line 163, in _append_path
return _append_paths(ctx, [path], [transform], clip)
File "<redacted>/.venv/lib/python3.6/site-packages/matplotlib/backends/backend_cairo.py", line 104, in _append_paths_slow
*np.concatenate([cur / 3 + points[:2] * 2 / 3,
TypeError: unsupported operand type(s) for /: 'tuple' and 'int'

Expected outcome

The expected outcome is that a legend with the text "Sample Text" would be displayed and there would be no stack trace.

Matplotlib version

Operating system: Fedora 28 x64

Matplotlib version: 3.0.2 (Installed from PyPi with PIP)

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

Python version: 3.6

Jupyter version (if applicable): N/A

Other libraries: N/A

Issue 2:
Saving a figure with plt.savefig in svg file format using the cairo backend results in a TypeError. The Traceback is:

/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/util/plot.py(814)save_and_close_fig()
-> plt.savefig('plot.svg', transparent=True, dpi=800)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/pyplot.py(689)savefig()
-> res = fig.savefig(*args, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/figure.py(2094)savefig()
-> self.canvas.print_figure(fname, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/backend_bases.py(2075)print_figure()
-> **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/backends/backend_cairo.py(569)print_svg()
-> return self._save(fobj, 'svg', *args, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/backends/backend_cairo.py(622)_save()
-> self.figure.draw(renderer)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/artist.py(50)draw_wrapper()
-> return draw(artist, renderer, *args, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/figure.py(1649)draw()
-> renderer, self, artists, self.suppressComposite)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/image.py(138)_draw_list_compositing_images()
-> a.draw(renderer)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/artist.py(50)draw_wrapper()
-> return draw(artist, renderer, *args, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/axes/_base.py(2628)draw()
-> mimage._draw_list_compositing_images(renderer, self, artists)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/image.py(138)_draw_list_compositing_images()
-> a.draw(renderer)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/artist.py(50)draw_wrapper()
-> return draw(artist, renderer, *args, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/legend.py(646)draw()
-> self.legendPatch.draw(renderer)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/artist.py(50)draw_wrapper()
-> return draw(artist, renderer, *args, **kwargs)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/patches.py(535)draw()
-> renderer.draw_path(gc, tpath, affine, rgbFace)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/backends/backend_cairo.py(239)draw_path()
-> _append_path(ctx, path, transform, clip)
/sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/backends/backend_cairo.py(163)_append_path()
-> return _append_paths(ctx, [path], [transform], clip)
> /sfs/fs5/home-sh/sunip229/opt/miniconda3/envs/py37_forge_jore/lib/python3.7/site-packages/matplotlib/backends/backend_cairo.py(104)_append_paths_slow()
-> *np.concatenate([cur / 3 + points[:2] * 2 / 3,
(Pdb) points[:2]
array([404.72 , 67.472])
(Pdb) cur
(400.71875, 67.47265625)

It seams like the value of cur should be an array and not a tuple.

The versions of the related programs are:

cairo 1.14.12 h276e583_5 conda-forge
matplotlib 3.0.2 h8a2030e_0 conda-forge
matplotlib-base 3.0.2 py37h20b835b_0 conda-forge
pycairo 1.18.0 py37h4d1f301_0 conda-forge
python 3.7.0 h5001a0f_4 conda-forge

The bug occurred at several plots. However, the creation of the plots is rather complex. Thus I have no minimal example that reproduces the bug for now. If this is necessary, however, I can try to construct one.