diff --git a/lib/matplotlib/streamplot.py b/lib/matplotlib/streamplot.py index 6de221476490..481e7d594b95 100644 --- a/lib/matplotlib/streamplot.py +++ b/lib/matplotlib/streamplot.py @@ -570,7 +570,7 @@ def _integrate_rk12(x0, y0, dmap, f, maxlength): dx2 = ds * 0.5 * (k1x + k2x) dy2 = ds * 0.5 * (k1y + k2y) - nx, ny = dmap.grid.shape + ny, nx = dmap.grid.shape # Error is normalized to the axes coordinates error = np.hypot((dx2 - dx1) / (nx - 1), (dy2 - dy1) / (ny - 1)) 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 7f29b4a9eabf..f13892ba2bc5 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 99d7e1d44cd8..21f202e5edec 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 869361f76dd0..a95118c95d97 100644 --- a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.svg +++ b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_colormap.svg @@ -1,12 +1,23 @@ - - + + + + + + 2021-08-18T03:11:20.912289 + image/svg+xml + + + Matplotlib v3.4.2.post1692+gb0554f4824.d20210818, https://matplotlib.org/ + + + + + - + @@ -15,7 +26,7 @@ L 460.8 345.6 L 460.8 0 L 0 0 z -" style="fill:#ffffff;"/> +" style="fill: #ffffff"/> @@ -24,60 +35,60 @@ L 343.296 307.584 L 343.296 41.472 L 57.6 41.472 z -" style="fill:#ffffff;"/> +" style="fill: #ffffff"/> - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + @@ -86,2474 +97,2551 @@ L 0 3.5 - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - - - - - - - - + + + + + + + + + - + - - - + + + - + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - - + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + + - + - + - - - + + + - + - + - - - - - - - + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + - + - - - + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - +" clip-path="url(#p3b712018f5)" style="fill: none; stroke: #ffb000; stroke-width: 2"/> + + + + + + + + + + + + + + + + - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffb900; stroke: #ffb900; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff3a00; stroke: #ff3a00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff8a00; stroke: #ff8a00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff7b00; stroke: #ff7b00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffa800; stroke: #ffa800; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffaa00; stroke: #ffaa00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffa200; stroke: #ffa200; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff8c00; stroke: #ff8c00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff7b00; stroke: #ff7b00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff7500; stroke: #ff7500; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff4400; stroke: #ff4400; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffbf00; stroke: #ffbf00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffc100; stroke: #ffc100; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffdf00; stroke: #ffdf00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffeb00; stroke: #ffeb00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #fffb00; stroke: #fffb00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #fff200; stroke: #fff200; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #fff500; stroke: #fff500; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffed00; stroke: #ffed00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffce00; stroke: #ffce00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffc200; stroke: #ffc200; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffb300; stroke: #ffb300; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff9f00; stroke: #ff9f00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff8d00; stroke: #ff8d00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffc700; stroke: #ffc700; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff9700; stroke: #ff9700; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffa300; stroke: #ffa300; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffa700; stroke: #ffa700; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff4e00; stroke: #ff4e00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff4600; stroke: #ff4600; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff1f00; stroke: #ff1f00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffa300; stroke: #ffa300; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff4c00; stroke: #ff4c00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff8600; stroke: #ff8600; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff7400; stroke: #ff7400; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff5e00; stroke: #ff5e00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff8000; stroke: #ff8000; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff8700; stroke: #ff8700; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff4f00; stroke: #ff4f00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff7600; stroke: #ff7600; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ff5e00; stroke: #ff5e00; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffb100; stroke: #ffb100; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffe400; stroke: #ffe400; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffa400; stroke: #ffa400; stroke-width: 2; stroke-linecap: round"/> - - + +" clip-path="url(#p3b712018f5)" style="fill: #ffc300; stroke: #ffc300; stroke-width: 2; stroke-linecap: round"/> + + + + + + + + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - - + +" style="fill: #ffffff"/> - - - + + + + + - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + - + + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - - + + - - + + 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 f1644d5b613c..1b14d45c3059 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 51e4e5d859c6..b928223c3206 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 ba0baa1da49e..2a2bec622027 100644 --- a/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.svg +++ b/lib/matplotlib/tests/baseline_images/test_streamplot/streamplot_linewidth.svg @@ -1,12 +1,23 @@ - - + + + + + + 2021-08-18T03:24:40.872884 + image/svg+xml + + + Matplotlib v3.4.2.post1692+gb0554f4824.d20210818, https://matplotlib.org/ + + + + + - + @@ -15,7 +26,7 @@ L 460.8 345.6 L 460.8 0 L 0 0 z -" style="fill:#ffffff;"/> +" style="fill: #ffffff"/> @@ -24,60 +35,60 @@ L 414.72 307.584 L 414.72 41.472 L 57.6 41.472 z -" style="fill:#ffffff;"/> +" style="fill: #ffffff"/> - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + @@ -86,2462 +97,3002 @@ L 0 3.5 - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +" clip-path="url(#p122428e17d)" style="fill: none; stroke: #000000; stroke-width: 5"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.646693; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.763217; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.085853; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.024196; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.335626; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.703123; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.140137; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.446783; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 3.39267; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.997896; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.689053; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.412889; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.596691; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.731148; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.826019; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.324419; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.981644; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.611973; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.459108; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.704699; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.433977; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.835914; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.347416; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.312264; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.138664; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.604062; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.274401; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.315827; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.95716; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.721473; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.468045; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 3.216579; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.887734; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.377428; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.158777; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 0.644319; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.44633; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.931274; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.117826; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 3.027536; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.576524; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.682513; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.441104; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.437048; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.108591; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 2.933469; stroke-linecap: round"/> - - + +" clip-path="url(#p122428e17d)" style="stroke: #000000; stroke-width: 1.361439; stroke-linecap: round"/> + + + + + + + + + + + + + + + + + + + + + + + + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - - + + 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 f8f94f0b2a3f..7d6beca0b3ac 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 02800cbde2c4..c3ce699983c4 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 8b40bc4c66f9..17e4c78c2490 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 @@ -1,12 +1,23 @@ - - + + + + + + 2021-08-18T03:08:55.311923 + image/svg+xml + + + Matplotlib v3.4.2.post1692+gb0554f4824, https://matplotlib.org/ + + + + + - + @@ -15,7 +26,7 @@ L 460.8 345.6 L 460.8 0 L 0 0 z -" style="fill:#ffffff;"/> +" style="fill: #ffffff"/> @@ -24,60 +35,60 @@ L 414.72 307.584 L 414.72 41.472 L 57.6 41.472 z -" style="fill:#ffffff;"/> +" style="fill: #ffffff"/> - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + @@ -86,3624 +97,3749 @@ L 0 3.5 - +" style="stroke: #000000; stroke-width: 0.8"/> - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - - - + + + + + + + - + - - - - - - - - - + + + + + + + + + - + - - - - - - + + + + + + - + - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - - - + + + + + + + - + - - - - - - + + + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + - + - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + - + - + - + - + - - - - - +" clip-path="url(#p0ebb051c42)" style="fill: none; stroke: #0a549e; stroke-width: 1.5"/> + + + + + + + + + - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2c7cba; stroke: #2c7cba; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #3e8ec4; stroke: #3e8ec4; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #3282be; stroke: #3282be; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #3a8ac2; stroke: #3a8ac2; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #56a0ce; stroke: #56a0ce; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #4292c6; stroke: #4292c6; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #7ab6d9; stroke: #7ab6d9; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #8dc1dd; stroke: #8dc1dd; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #87bddc; stroke: #87bddc; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #c7dbef; stroke: #c7dbef; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #cfe1f2; stroke: #cfe1f2; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #e1edf8; stroke: #e1edf8; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2474b7; stroke: #2474b7; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2070b4; stroke: #2070b4; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #115ca5; stroke: #115ca5; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #09529d; stroke: #09529d; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #084c95; stroke: #084c95; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #084285; stroke: #084285; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #083979; stroke: #083979; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #083776; stroke: #083776; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #083979; stroke: #083979; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #084184; stroke: #084184; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #084387; stroke: #084387; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #125ea6; stroke: #125ea6; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #0f5aa3; stroke: #0f5aa3; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #1c6ab0; stroke: #1c6ab0; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2171b5; stroke: #2171b5; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2d7dbb; stroke: #2d7dbb; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #3888c1; stroke: #3888c1; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #4493c7; stroke: #4493c7; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #519ccc; stroke: #519ccc; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #68acd5; stroke: #68acd5; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #4e9acb; stroke: #4e9acb; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #539ecd; stroke: #539ecd; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #81badb; stroke: #81badb; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #9fcae1; stroke: #9fcae1; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #60a7d2; stroke: #60a7d2; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2979b9; stroke: #2979b9; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #9dcae1; stroke: #9dcae1; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #5ba3d0; stroke: #5ba3d0; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #c2d9ee; stroke: #c2d9ee; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #65aad4; stroke: #65aad4; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #61a7d2; stroke: #61a7d2; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #87bddc; stroke: #87bddc; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #58a1cf; stroke: #58a1cf; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #65aad4; stroke: #65aad4; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #bfd8ed; stroke: #bfd8ed; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #4b98ca; stroke: #4b98ca; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #b7d4ea; stroke: #b7d4ea; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #539ecd; stroke: #539ecd; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #add0e6; stroke: #add0e6; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #5ca4d0; stroke: #5ca4d0; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #89bedc; stroke: #89bedc; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #63a8d3; stroke: #63a8d3; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #95c5df; stroke: #95c5df; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #72b2d8; stroke: #72b2d8; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #8abfdd; stroke: #8abfdd; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #7fb9da; stroke: #7fb9da; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #4896c8; stroke: #4896c8; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #0a539e; stroke: #0a539e; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #4896c8; stroke: #4896c8; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #549fcd; stroke: #549fcd; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #75b4d8; stroke: #75b4d8; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #65aad4; stroke: #65aad4; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2474b7; stroke: #2474b7; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #56a0ce; stroke: #56a0ce; stroke-width: 1.5; stroke-linecap: round"/> - - + +" clip-path="url(#p0ebb051c42)" style="fill: #2b7bba; stroke: #2b7bba; stroke-width: 1.5; stroke-linecap: round"/> + + + + + + + + + + + + + + + + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - + +" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/> - - + + 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 f9bf53975faf..a773da141920 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/test_streamplot.py b/lib/matplotlib/tests/test_streamplot.py index 3ed111881782..88c3ec2768e9 100644 --- a/lib/matplotlib/tests/test_streamplot.py +++ b/lib/matplotlib/tests/test_streamplot.py @@ -1,5 +1,3 @@ -import sys - import numpy as np from numpy.testing import assert_array_almost_equal import pytest @@ -8,19 +6,15 @@ import matplotlib.transforms as mtransforms -on_win = (sys.platform == 'win32') -on_mac = (sys.platform == 'darwin') - - def velocity_field(): - Y, X = np.mgrid[-3:3:100j, -3:3:100j] + Y, X = np.mgrid[-3:3:100j, -3:3:200j] U = -1 - X**2 + Y V = 1 + X - Y**2 return X, Y, U, V def swirl_velocity_field(): - x = np.linspace(-3., 3., 100) + x = np.linspace(-3., 3., 200) y = np.linspace(-3., 3., 100) X, Y = np.meshgrid(x, y) a = 0.1 @@ -29,7 +23,8 @@ def swirl_velocity_field(): return x, y, U, V -@image_comparison(['streamplot_startpoints'], remove_text=True, style='mpl20') +@image_comparison(['streamplot_startpoints'], remove_text=True, style='mpl20', + tol=0.513) def test_startpoints(): X, Y, U, V = velocity_field() start_x = np.linspace(X.min(), X.max(), 10) @@ -39,51 +34,39 @@ def test_startpoints(): plt.plot(start_x, start_y, 'ok') -@image_comparison(['streamplot_colormap'], - tol=.04, remove_text=True, style='mpl20') +@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20') def test_colormap(): - # Remove this line when this test image is regenerated. - plt.rcParams['pcolormesh.snap'] = False - X, Y, U, V = velocity_field() plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2, cmap=plt.cm.autumn) plt.colorbar() -@image_comparison(['streamplot_linewidth'], remove_text=True, style='mpl20') +@image_comparison(['streamplot_linewidth'], remove_text=True, style='mpl20', + tol=0.002) def test_linewidth(): X, Y, U, V = velocity_field() speed = np.hypot(U, V) lw = 5 * speed / speed.max() - # Compatibility for old test image - df = 25 / 30 ax = plt.figure().subplots() - ax.set(xlim=(-3.0, 2.9999999999999947), - ylim=(-3.0000000000000004, 2.9999999999999947)) - ax.streamplot(X, Y, U, V, density=[0.5 * df, 1. * df], color='k', - linewidth=lw) + ax.streamplot(X, Y, U, V, density=[0.5, 1], color='k', linewidth=lw) @image_comparison(['streamplot_masks_and_nans'], - remove_text=True, style='mpl20', tol=0.04 if on_win else 0) + remove_text=True, style='mpl20') def test_masks_and_nans(): X, Y, U, V = velocity_field() mask = np.zeros(U.shape, dtype=bool) - mask[40:60, 40:60] = 1 - U[:20, :20] = np.nan + mask[40:60, 80:120] = 1 + U[:20, :40] = np.nan U = np.ma.array(U, mask=mask) - # Compatibility for old test image ax = plt.figure().subplots() - ax.set(xlim=(-3.0, 2.9999999999999947), - ylim=(-3.0000000000000004, 2.9999999999999947)) with np.errstate(invalid='ignore'): ax.streamplot(X, Y, U, V, color=U, cmap=plt.cm.Blues) @image_comparison(['streamplot_maxlength.png'], - remove_text=True, style='mpl20', - tol=0.002 if on_mac else 0) + remove_text=True, style='mpl20', tol=0.302) def test_maxlength(): x, y, U, V = swirl_velocity_field() ax = plt.figure().subplots() @@ -95,7 +78,7 @@ def test_maxlength(): @image_comparison(['streamplot_direction.png'], - remove_text=True, style='mpl20') + remove_text=True, style='mpl20', tol=0.056) def test_direction(): x, y, U, V = swirl_velocity_field() plt.streamplot(x, y, U, V, integration_direction='backward',