Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22a8fcf

Browse filesBrowse files
committed
add tests for all matplotlib.rc() aliases
1 parent fa3f5f5 commit 22a8fcf
Copy full SHA for 22a8fcf

File tree

Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed

‎lib/matplotlib/tests/test_rcparams.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_rcparams.py
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,21 @@ def test_rcparams_path_sketch_from_file(tmp_path, value):
654654
rc_path.write_text(f"path.sketch: {value}")
655655
with mpl.rc_context(fname=rc_path):
656656
assert mpl.rcParams["path.sketch"] == (1, 2, 3)
657+
658+
659+
@pytest.mark.parametrize('group, option, alias, value', [
660+
('lines', 'linewidth', 'lw', 3),
661+
('lines', 'linestyle', 'ls', 'dashed'),
662+
('lines', 'color', 'c', 'white'),
663+
('axes', 'facecolor', 'fc', 'black'),
664+
('figure', 'edgecolor', 'ec', 'magenta'),
665+
('lines', 'markeredgewidth', 'mew', 1.5),
666+
('patch', 'antialiased', 'aa', False),
667+
('font', 'sans-serif', 'sans', ["Verdana"])
668+
])
669+
def test_rc_aliases(group, option, alias, value):
670+
rc_kwargs = {alias: value,}
671+
mpl.rc(group, **rc_kwargs)
672+
673+
rcParams_key = f"{group}.{option}"
674+
assert mpl.rcParams[rcParams_key] == value

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.