@@ -90,24 +90,23 @@ def test_axvspan(self):
90
90
@mpl .style .context ("default" )
91
91
def test_bar (self ):
92
92
mpl .rcParams ["date.converter" ] = "concise"
93
- range_threshold = 10
94
- fig , (ax1 , ax2 , ax3 , ax4 ) = plt .subplots (4 , 1 , layout = "constrained" )
93
+
94
+ fig , (ax1 , ax2 ) = plt .subplots (2 , 1 , layout = "constrained" )
95
95
96
96
x_dates = np .array (
97
- [datetime .datetime (2023 , 10 , delta ) for delta in range (1 , range_threshold )],
97
+ [
98
+ datetime (2020 , 6 , 30 ),
99
+ datetime (2020 , 7 , 22 ),
100
+ datetime (2020 , 8 , 3 ),
101
+ datetime (2020 , 9 , 14 ),
102
+ ],
98
103
dtype = np .datetime64 ,
99
104
)
100
- y_dates = np .array (
101
- [datetime .datetime (2023 , 10 , delta ) for delta in range (1 , range_threshold )],
102
- dtype = np .datetime64 ,
103
- )
104
- x_ranges = np .array (range (1 , range_threshold ))
105
- y_ranges = np .array (range (1 , range_threshold ))
105
+ x_ranges = [8800 , 2600 , 8500 , 7400 ]
106
106
107
- ax1 .bar (x_dates , y_ranges , width = np .timedelta64 (range_threshold , "D" ))
108
- ax2 .bar (x_dates , y_dates , width = np .timedelta64 (range_threshold , "D" ))
109
- ax3 .bar (x_ranges , y_dates , width = np .timedelta64 (range_threshold , "D" ))
110
- ax4 .bar (x_ranges , y_ranges , bottom = datetime .datetime (2023 , 10 , 1 ))
107
+ x = np .datetime64 (datetime (2020 , 6 , 1 ))
108
+ ax1 .bar (x_dates , x_ranges , width = np .timedelta64 (4 , "D" ))
109
+ ax2 .bar (np .arange (4 ), x_dates , bottom = x )
111
110
112
111
@pytest .mark .xfail (reason = "Test for bar_label not written yet" )
113
112
@mpl .style .context ("default" )
0 commit comments