MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_eventplot_problem_kwargs

Function test_eventplot_problem_kwargs

lib/matplotlib/tests/test_axes.py:5538–5563  ·  view source on GitHub ↗

test that 'singular' versions of LineCollection props raise an MatplotlibDeprecationWarning rather than overriding the 'plural' versions (e.g., to prevent 'color' from overriding 'colors', see issue #4297)

(recwarn)

Source from the content-addressed store, hash-verified

5536@image_comparison(['test_eventplot_problem_kwargs.png'], remove_text=True,
5537 style='_classic_test')
5538def test_eventplot_problem_kwargs(recwarn):
5539 """
5540 test that 'singular' versions of LineCollection props raise an
5541 MatplotlibDeprecationWarning rather than overriding the 'plural' versions
5542 (e.g., to prevent 'color' from overriding 'colors', see issue #4297)
5543 """
5544 np.random.seed(0)
5545
5546 data1 = np.random.random([20]).tolist()
5547 data2 = np.random.random([10]).tolist()
5548 data = [data1, data2]
5549
5550 fig = plt.figure()
5551 axobj = fig.add_subplot()
5552
5553 axobj.eventplot(data,
5554 colors=['r', 'b'],
5555 color=['c', 'm'],
5556 linewidths=[2, 1],
5557 linewidth=[1, 2],
5558 linestyles=['solid', 'dashed'],
5559 linestyle=['dashdot', 'dotted'])
5560
5561 assert len(recwarn) == 3
5562 assert all(issubclass(wi.category, mpl.MatplotlibDeprecationWarning)
5563 for wi in recwarn)
5564
5565
5566def test_empty_eventplot():

Callers

nothing calls this directly

Calls 3

figureMethod · 0.80
add_subplotMethod · 0.80
eventplotMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…