Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2860571

Browse files
committed
Test antialiased default setting
1 parent e1da8bc commit 2860571

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/matplotlib/tests/test_patches.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import matplotlib.pyplot as plt
1212
from matplotlib import (
1313
collections as mcollections, colors as mcolors, patches as mpatches,
14-
path as mpath, style as mstyle, transforms as mtransforms)
14+
path as mpath, style as mstyle, transforms as mtransforms, rcParams)
1515

1616
import sys
1717
on_win = (sys.platform == 'win32')
@@ -576,3 +576,13 @@ def test_color_override_warning(kwarg):
576576
def test_empty_verts():
577577
poly = Polygon(np.zeros((0, 2)))
578578
assert poly.get_verts() == []
579+
580+
581+
def test_default_antialiased():
582+
patch = Patch()
583+
584+
patch.set_antialiased(not rcParams['patch.antialiased'])
585+
assert patch.get_antialiased() == (not rcParams['patch.antialiased'])
586+
# Check that None resets the state
587+
patch.set_antialiased(None)
588+
assert patch.get_antialiased() == rcParams['patch.antialiased']

0 commit comments

Comments
 (0)