11from __future__ import (absolute_import , division , print_function ,
22 unicode_literals )
33
4+ import sys
5+
46import numpy as np
57from numpy .testing import assert_array_almost_equal
68import matplotlib .pyplot as plt
79from matplotlib .testing .decorators import image_comparison
810import matplotlib .transforms as mtransforms
911
1012
13+ on_win = (sys .platform == 'win32' )
14+
15+
1116def velocity_field ():
1217 Y , X = np .mgrid [- 3 :3 :100j , - 3 :3 :100j ]
1318 U = - 1 - X ** 2 + Y
@@ -35,8 +40,7 @@ def test_startpoints():
3540 plt .plot (start_x , start_y , 'ok' )
3641
3742
38- @image_comparison (baseline_images = ['streamplot_colormap' ],
39- tol = 0.002 )
43+ @image_comparison (baseline_images = ['streamplot_colormap' ])
4044def test_colormap ():
4145 X , Y , U , V = velocity_field ()
4246 plt .streamplot (X , Y , U , V , color = U , density = 0.6 , linewidth = 2 ,
@@ -54,7 +58,8 @@ def test_linewidth():
5458 linewidth = lw )
5559
5660
57- @image_comparison (baseline_images = ['streamplot_masks_and_nans' ])
61+ @image_comparison (baseline_images = ['streamplot_masks_and_nans' ],
62+ tol = 0.04 if on_win else 0 )
5863def test_masks_and_nans ():
5964 X , Y , U , V = velocity_field ()
6065 mask = np .zeros (U .shape , dtype = bool )
0 commit comments