Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mplexporter/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
if matplotlib.__version__ >= '2':
plt.style.use('classic')
19 changes: 13 additions & 6 deletions mplexporter/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from numpy.testing import assert_allclose, assert_equal
from . import plt
from . import matplotlib, plt
from .. import utils


Expand All @@ -12,11 +12,18 @@ def test_path_data():


def test_linestyle():
linestyles = {'solid': 'none', '-': 'none',
'dashed': '6,6', '--': '6,6',
'dotted': '2,2', ':': '2,2',
'dashdot': '4,4,2,4', '-.': '4,4,2,4',
'': None, 'None': None}
if matplotlib.__version__ >= '2':
linestyles = {'solid': 'none', '-': 'none',
'dashed': '6.0,6.0', '--': '6.0,6.0',
'dotted': '1.0,3.0', ':': '1.0,3.0',
'dashdot': '3.0,5.0,1.0,5.0', '-.': '3.0,5.0,1.0,5.0',
'': None, 'None': None}
else:
linestyles = {'solid': 'none', '-': 'none',
'dashed': '6,6', '--': '6,6',
'dotted': '2,2', ':': '2,2',
'dashdot': '4,4,2,4', '-.': '4,4,2,4',
'': None, 'None': None}

for ls, result in linestyles.items():
line, = plt.plot([1, 2, 3], linestyle=ls)
Expand Down