File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
pandas/tests/plotting/frame Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 3
3
instead of one Line2D per column (PR #61764).
4
4
"""
5
5
6
- from matplotlib .collections import LineCollection
7
- import matplotlib .pyplot as plt
8
6
import numpy as np
7
+ import pytest
9
8
10
9
import pandas as pd
11
10
11
+ # Skip this entire module if matplotlib is not installed
12
+ mpl = pytest .importorskip ("matplotlib" )
13
+ plt = pytest .importorskip ("matplotlib.pyplot" )
14
+ from matplotlib .collections import LineCollection
15
+
12
16
13
17
def test_linecollection_used_for_wide_dataframe ():
14
18
rng = np .random .default_rng (0 )
15
19
df = pd .DataFrame (rng .standard_normal ((10 , 201 )).cumsum (axis = 0 ))
16
20
17
21
ax = df .plot (legend = False )
18
22
19
- # one LineCollection, zero Line2D objects
23
+ # exactly one LineCollection, and no Line2D artists
20
24
assert sum (isinstance (c , LineCollection ) for c in ax .collections ) == 1
21
25
assert len (ax .lines ) == 0
22
26
You can’t perform that action at this time.
0 commit comments