diff --git a/lib/matplotlib/streamplot.py b/lib/matplotlib/streamplot.py
index f8e431d20a2f..f1886f3fa7a8 100644
--- a/lib/matplotlib/streamplot.py
+++ b/lib/matplotlib/streamplot.py
@@ -133,7 +133,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
line_kw['zorder'] = zorder
arrow_kw['zorder'] = zorder
- ## Sanity checks.
+ # Sanity checks.
if u.shape != grid.shape or v.shape != grid.shape:
raise ValueError("'u' and 'v' must match the shape of 'Grid(x, y)'")
@@ -156,8 +156,8 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
# Check if start_points are outside the data boundaries
for xs, ys in sp2:
- if not (grid.x_origin <= xs <= grid.x_origin + grid.width
- and grid.y_origin <= ys <= grid.y_origin + grid.height):
+ if not (grid.x_origin <= xs <= grid.x_origin + grid.width and
+ grid.y_origin <= ys <= grid.y_origin + grid.height):
raise ValueError("Starting point ({}, {}) outside of data "
"boundaries".format(xs, ys))
@@ -263,8 +263,8 @@ def __init__(self, grid, mask):
self.grid = grid
self.mask = mask
# Constants for conversion between grid- and mask-coordinates
- self.x_grid2mask = (mask.nx - 1) / grid.nx
- self.y_grid2mask = (mask.ny - 1) / grid.ny
+ self.x_grid2mask = (mask.nx - 1) / (grid.nx - 1)
+ self.y_grid2mask = (mask.ny - 1) / (grid.ny - 1)
self.x_mask2grid = 1. / self.x_grid2mask
self.y_mask2grid = 1. / self.y_grid2mask
@@ -413,7 +413,7 @@ class TerminateTrajectory(Exception):
# Integrator definitions
-#========================
+# =======================
def get_integrator(u, v, dmap, minlength, maxlength, integration_direction):
@@ -421,11 +421,13 @@ def get_integrator(u, v, dmap, minlength, maxlength, integration_direction):
u, v = dmap.data2grid(u, v)
# speed (path length) will be in axes-coordinates
- u_ax = u / dmap.grid.nx
- v_ax = v / dmap.grid.ny
+ u_ax = u / (dmap.grid.nx - 1)
+ v_ax = v / (dmap.grid.ny - 1)
speed = np.ma.sqrt(u_ax ** 2 + v_ax ** 2)
def forward_time(xi, yi):
+ if not dmap.grid.within_grid(xi, yi):
+ raise OutOfBounds
ds_dt = interpgrid(speed, xi, yi)
if ds_dt == 0:
raise TerminateTrajectory()
@@ -480,6 +482,10 @@ def integrate(x0, y0):
return integrate
+class OutOfBounds(IndexError):
+ pass
+
+
def _integrate_rk12(x0, y0, dmap, f, maxlength):
"""2nd-order Runge-Kutta algorithm with adaptive step size.
@@ -523,18 +529,28 @@ def _integrate_rk12(x0, y0, dmap, f, maxlength):
xf_traj = []
yf_traj = []
- while dmap.grid.within_grid(xi, yi):
- xf_traj.append(xi)
- yf_traj.append(yi)
+ while True:
try:
+ if dmap.grid.within_grid(xi, yi):
+ xf_traj.append(xi)
+ yf_traj.append(yi)
+ else:
+ raise OutOfBounds
+
+ # Compute the two intermediate gradients.
+ # f should raise OutOfBounds if the locations given are
+ # outside the grid.
k1x, k1y = f(xi, yi)
- k2x, k2y = f(xi + ds * k1x,
- yi + ds * k1y)
- except IndexError:
- # Out of the domain on one of the intermediate integration steps.
- # Take an Euler step to the boundary to improve neatness.
- ds, xf_traj, yf_traj = _euler_step(xf_traj, yf_traj, dmap, f)
- stotal += ds
+ k2x, k2y = f(xi + ds * k1x, yi + ds * k1y)
+
+ except OutOfBounds:
+ # Out of the domain during this step.
+ # Take an Euler step to the boundary to improve neatness
+ # unless the trajectory is currently empty.
+ if xf_traj:
+ ds, xf_traj, yf_traj = _euler_step(xf_traj, yf_traj,
+ dmap, f)
+ stotal += ds
break
except TerminateTrajectory:
break
@@ -546,7 +562,7 @@ def _integrate_rk12(x0, y0, dmap, f, maxlength):
nx, ny = dmap.grid.shape
# Error is normalized to the axes coordinates
- error = np.hypot((dx2 - dx1) / nx, (dy2 - dy1) / ny)
+ error = np.hypot((dx2 - dx1) / (nx - 1), (dy2 - dy1) / (ny - 1))
# Only save step if within error tolerance
if error < maxerror:
@@ -651,7 +667,6 @@ def _gen_starting_points(shape):
x, y = 0, 0
direction = 'right'
for i in range(nx * ny):
-
yield x, y
if direction == 'right':
diff --git a/lib/matplotlib/tests/baseline_images/test_pickle/multi_pickle.png b/lib/matplotlib/tests/baseline_images/test_pickle/multi_pickle.png
index d399b380d44d..3a6f41fa2948 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_pickle/multi_pickle.png and b/lib/matplotlib/tests/baseline_images/test_pickle/multi_pickle.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.pdf b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.pdf
index afc2f2966475..7f29b4a9eabf 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.pdf and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.pdf differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.png b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.png
index fed48765d45e..99d7e1d44cd8 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.png and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.svg b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.svg
index ae46e125d162..869361f76dd0 100644
--- a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.svg
+++ b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.svg
@@ -32,52 +32,52 @@ z
+" id="mb2750bda3d" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -88,2497 +88,2383 @@ L 0 3.5
+" id="m3bf521d46f" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+" style="fill:#ffb900;stroke:#ffb900;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff3a00;stroke:#ff3a00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff8a00;stroke:#ff8a00;stroke-linecap:round;stroke-width:2;"/>
-
-
-
-
+
+" style="fill:#ffa800;stroke:#ffa800;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffaa00;stroke:#ffaa00;stroke-linecap:round;stroke-width:2;"/>
-
-
-
-
+
+" style="fill:#ff8c00;stroke:#ff8c00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff7b00;stroke:#ff7b00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff7500;stroke:#ff7500;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff4400;stroke:#ff4400;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffd400;stroke:#ffd400;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffa300;stroke:#ffa300;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff8000;stroke:#ff8000;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff3000;stroke:#ff3000;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff8b00;stroke:#ff8b00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff3c00;stroke:#ff3c00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff9900;stroke:#ff9900;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff6800;stroke:#ff6800;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff7400;stroke:#ff7400;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff5a00;stroke:#ff5a00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff6600;stroke:#ff6600;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffc400;stroke:#ffc400;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffdf00;stroke:#ffdf00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffeb00;stroke:#ffeb00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#fffb00;stroke:#fffb00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#fff200;stroke:#fff200;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#fff500;stroke:#fff500;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#fff200;stroke:#fff200;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffe500;stroke:#ffe500;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffc200;stroke:#ffc200;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffb300;stroke:#ffb300;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff9f00;stroke:#ff9f00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff8d00;stroke:#ff8d00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff5c00;stroke:#ff5c00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffc700;stroke:#ffc700;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff9700;stroke:#ff9700;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffa300;stroke:#ffa300;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffa700;stroke:#ffa700;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff4e00;stroke:#ff4e00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ff4600;stroke:#ff4600;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffe400;stroke:#ffe400;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffbb00;stroke:#ffbb00;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffc300;stroke:#ffc300;stroke-linecap:round;stroke-width:2;"/>
-
-
+
+" style="fill:#ffd200;stroke:#ffd200;stroke-linecap:round;stroke-width:2;"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
-
+
-
@@ -2598,57 +2484,57 @@ iVBORw0KGgoAAAANSUhEUgAAABIAAAFxCAYAAAB+2fgXAAAABHNCSVQICAgIfAhkiAAAAPdJREFUeJzt
+" id="mf4df04ec05" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
+
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_direction.png b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_direction.png
index 8bfb6ba1b63a..835e159665c9 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_direction.png and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_direction.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.pdf b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.pdf
index 9f29d679f5b8..f1644d5b613c 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.pdf and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.pdf differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.png b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.png
index c1147e478698..51e4e5d859c6 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.png and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.svg b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.svg
index 8ce3e3ed3eae..ba0baa1da49e 100644
--- a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.svg
+++ b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.svg
@@ -32,52 +32,52 @@ z
+" id="ma91ea6e729" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.658494;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.152148;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.955513;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.623516;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.029769;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:3.118013;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:3.596175;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.894399;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.041015;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.230553;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.916174;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.36946;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.829099;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.743426;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.684836;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.519272;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.481109;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.259631;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.240416;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.295162;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.94594;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.939757;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.027322;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.697644;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.178553;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.334;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.533187;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.346082;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.266107;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.098575;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.020742;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.935291;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.107181;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.052548;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.152229;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.493027;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.771268;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.122935;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.772422;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.920661;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.709147;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:2.8978;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.053016;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.147049;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:1.105066;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.24859;"/>
-
-
+
+" style="stroke:#000000;stroke-linecap:round;stroke-width:0.714278;"/>
-
-
-
-
-
-
-
-
-
+
-
+
-
+
@@ -2586,7 +2540,7 @@ L 414.72 41.472
-
+
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.pdf b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.pdf
index d06b6cf7159c..f8f94f0b2a3f 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.pdf and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.pdf differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.png b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.png
index 3a273017491d..02800cbde2c4 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.png and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.svg b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.svg
index f027722f3e91..8b40bc4c66f9 100644
--- a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.svg
+++ b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_masks_and_nans.svg
@@ -32,52 +32,52 @@ z
+" id="m94c26df6b7" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -88,3483 +88,3613 @@ L 0 3.5
+" id="m12d95443ee" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
+
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+" style="fill:#2c7cba;stroke:#2c7cba;stroke-linecap:round;stroke-width:1.5;"/>
-
-
-
-
-
-
+
+" style="fill:#3a8ac2;stroke:#3a8ac2;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#56a0ce;stroke:#56a0ce;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4292c6;stroke:#4292c6;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#7ab6d9;stroke:#7ab6d9;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#8dc1dd;stroke:#8dc1dd;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#87bddc;stroke:#87bddc;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#c7dbef;stroke:#c7dbef;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#cfe1f2;stroke:#cfe1f2;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#e1edf8;stroke:#e1edf8;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#7fb9da;stroke:#7fb9da;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#65aad4;stroke:#65aad4;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#3888c1;stroke:#3888c1;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4d99ca;stroke:#4d99ca;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#9cc9e1;stroke:#9cc9e1;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4594c7;stroke:#4594c7;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#91c3de;stroke:#91c3de;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4b98ca;stroke:#4b98ca;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#85bcdc;stroke:#85bcdc;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#9ac8e0;stroke:#9ac8e0;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4997c9;stroke:#4997c9;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#a5cde3;stroke:#a5cde3;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#64a9d3;stroke:#64a9d3;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#74b3d8;stroke:#74b3d8;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#6caed6;stroke:#6caed6;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#69add5;stroke:#69add5;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4e9acb;stroke:#4e9acb;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#1f6eb3;stroke:#1f6eb3;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#115ca5;stroke:#115ca5;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#084f99;stroke:#084f99;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#084c95;stroke:#084c95;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#084285;stroke:#084285;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#083979;stroke:#083979;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#083776;stroke:#083776;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#083979;stroke:#083979;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#083d7f;stroke:#083d7f;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#084387;stroke:#084387;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#125ea6;stroke:#125ea6;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#0f5aa3;stroke:#0f5aa3;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#1c6ab0;stroke:#1c6ab0;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#2171b5;stroke:#2171b5;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#2d7dbb;stroke:#2d7dbb;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#3888c1;stroke:#3888c1;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4493c7;stroke:#4493c7;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#519ccc;stroke:#519ccc;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#68acd5;stroke:#68acd5;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4e9acb;stroke:#4e9acb;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#539ecd;stroke:#539ecd;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#81badb;stroke:#81badb;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#9fcae1;stroke:#9fcae1;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#60a7d2;stroke:#60a7d2;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#2979b9;stroke:#2979b9;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#9dcae1;stroke:#9dcae1;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#5ba3d0;stroke:#5ba3d0;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#95c5df;stroke:#95c5df;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#0a539e;stroke:#0a539e;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#4896c8;stroke:#4896c8;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#549fcd;stroke:#549fcd;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#75b4d8;stroke:#75b4d8;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#65aad4;stroke:#65aad4;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#a6cee4;stroke:#a6cee4;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#2474b7;stroke:#2474b7;stroke-linecap:round;stroke-width:1.5;"/>
-
-
+
+" style="fill:#56a0ce;stroke:#56a0ce;stroke-linecap:round;stroke-width:1.5;"/>
+
+
+
+
+
+
+
+
-
+
-
+
-
+
@@ -3572,7 +3702,7 @@ L 414.72 41.472
-
+
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_maxlength.png b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_maxlength.png
index a71e6ee90226..4cc023134222 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_maxlength.png and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_maxlength.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.pdf b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.pdf
index 60d0bd0af49b..f9bf53975faf 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.pdf and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.pdf differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.png b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.png
index ef60a9e7e3c8..c2c3e28d3eab 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.png and b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.svg b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.svg
index 1e484908206c..fca2e620fa7c 100644
--- a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.svg
+++ b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_startpoints.svg
@@ -32,52 +32,52 @@ z
+" id="m32c7fdb7bc" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -88,1352 +88,1352 @@ L 0 3.5
+" id="m3972710557" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1449,19 +1449,19 @@ C -2.683901 -1.55874 -3 -0.795609 -3 0
C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132
C -1.55874 2.683901 -0.795609 3 0 3
z
-" id="m801944ab1f" style="stroke:#000000;"/>
+" id="m1037087b4d" style="stroke:#000000;"/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -1487,7 +1487,7 @@ L 414.72 41.472
-
+
diff --git a/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.pdf b/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.pdf
index 2c9b8745b7ac..640df51ac227 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.pdf and b/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.pdf differ
diff --git a/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.png b/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.png
index ecb478d9e7f6..22b08c23bd49 100644
Binary files a/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.png and b/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.png differ
diff --git a/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.svg b/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.svg
index 553ba736fea7..8d52765e3ae0 100644
--- a/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.svg
+++ b/lib/matplotlib/tests/baseline_images/test_transforms/pre_transform_data.svg
@@ -27,7 +27,7 @@ z
" style="fill:#ffffff;"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+" id="mefe0d42b30" style="stroke:#1f77b4;"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+" id="m6c17ba3a37" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
@@ -2495,2360 +2495,2971 @@ L 0 3.5
+" id="m4378636fdc" style="stroke:#000000;stroke-width:0.8;"/>
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.545955;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.74958;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.619709;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.462144;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.803067;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.091636;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.213619;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.866211;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.900453;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.045867;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.59602;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.477754;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.83707;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.065878;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.522951;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.50354;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.631535;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.812663;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.400306;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.015974;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.794259;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.770105;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.795728;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.865756;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.245398;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.571031;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.250101;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.254073;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.687928;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.617037;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:5.296523;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.697681;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.299378;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.317635;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.315565;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.846444;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.665544;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.372354;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.600247;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.569313;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:4.470562;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.279641;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.282435;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.95057;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:2.24063;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.504282;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:1.71902;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:5.141964;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.038853;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.176155;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:3.844646;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.62708;"/>
-
-
+
+" style="fill:#1f77b4;stroke:#1f77b4;stroke-linecap:round;stroke-width:0.205215;"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
@@ -4856,7 +5467,7 @@ L 414.72 41.472
-
+
diff --git a/lib/matplotlib/tests/test_streamplot.py b/lib/matplotlib/tests/test_streamplot.py
index 9ea89e049d19..d2218f6f288d 100644
--- a/lib/matplotlib/tests/test_streamplot.py
+++ b/lib/matplotlib/tests/test_streamplot.py
@@ -9,6 +9,7 @@
on_win = (sys.platform == 'win32')
+on_mac = (sys.platform == 'darwin')
def velocity_field():
@@ -79,7 +80,8 @@ def test_masks_and_nans():
@image_comparison(['streamplot_maxlength.png'],
- remove_text=True, style='mpl20')
+ remove_text=True, style='mpl20',
+ tol=0.002 if on_mac else 0)
def test_maxlength():
x, y, U, V = swirl_velocity_field()
ax = plt.figure().subplots()