10000 Merge pull request #10077 from QuLogic/cross-platform-barbs · matplotlib/matplotlib@e8c57c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8c57c5

Browse files
authored
Merge pull request #10077 from QuLogic/cross-platform-barbs
MNT: Use fuzzy comparison for stroke join determination.
2 parents 1dfa196 + 7216b8c commit e8c57c5

File tree

7 files changed

+11
-5
lines changed

7 files changed

+11
-5
lines changed

extern/agg24-svn/include/agg_math_stroke.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ namespace agg
391391
vc.remove_all();
392392

393393
double cp = cross_product(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y);
394-
if(cp != 0 && (cp > 0) == (m_width > 0))
394+
if ((cp > agg::vertex_dist_epsilon && m_width > 0) ||
395+
(cp < -agg::vertex_dist_epsilon && m_width < 0))
395396
{
396397
// Inner join
397398
//---------------
Loading
Loading
Loading
Loading

lib/matplotlib/tests/test_streamplot.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
from __future__ import absolute_import, division, print_function
22

3+
import sys
4+
35
import numpy as np
46
from numpy.testing import assert_array_almost_equal
57
import matplotlib.pyplot as plt
68
from matplotlib.testing.decorators import image_comparison
79
import matplotlib.transforms as mtransforms
810

911

12+
on_win = (sys.platform == 'win32')
13+
14+
1015
def velocity_field():
1116
Y, X = np.mgrid[-3:3:100j, -3:3:100j]
1217
U = -1 - X**2 + Y
@@ -34,8 +39,7 @@ def test_startpoints():
3439
plt.plot(start_x, start_y, 'ok')
3540

3641

37-
@image_comparison(baseline_images=['streamplot_colormap'],
38-
tol=0.002)
42+
@image_comparison(baseline_images=['streamplot_colormap'])
3943
def test_colormap():
4044
X, Y, U, V = velocity_field()
4145
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,
@@ -53,7 +57,8 @@ def test_linewidth():
5357
linewidth=lw)
5458

5559

56-
@image_comparison(baseline_images=['streamplot_masks_and_nans'])
60+
@image_comparison(baseline_images=['streamplot_masks_and_nans'],
61+
tol=0.04 if on_win else 0)
5762
def test_masks_and_nans():
5863
X, Y, U, V = velocity_field()
5964
mask = np.zeros(U.shape, dtype=bool)

lib/matplotlib/tests/test_triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def z(x, y):
784784

785785

786786
@image_comparison(baseline_images=['tri_smooth_gradient'],
787-
extensions=['png'], remove_text=True, tol=0.035)
787+
extensions=['png'], remove_text=True, tol=0.092)
788788
def test_tri_smooth_gradient():
789789
# Image comparison based on example trigradient_demo.
790790

0 commit comments

Comments
 (0)
0