11from __future__ import absolute_import , division , print_function
22
3+ import sys
4+
35import numpy as np
46from numpy .testing import assert_array_almost_equal
57import matplotlib .pyplot as plt
68from matplotlib .testing .decorators import image_comparison
79import matplotlib .transforms as mtransforms
810
911
12+ on_win = (sys .platform == 'win32' )
13+
14+
1015def 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' ])
3943def 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 )
5762def test_masks_and_nans ():
5863 X , Y , U , V = velocity_field ()
5964 mask = np .zeros (U .shape , dtype = bool )
0 commit comments