@@ -172,16 +172,19 @@ def test_hexbin(self):
172
172
173
173
@mpl .style .context ("default" )
174
174
def test_hist (self ):
175
- mpl .rcParams ["date.converter" ] = "concise"
176
- N = 10
177
- fig , (ax1 , ax2 , ax3 ) = plt .subplots (
178
- 3 , 1 , layout = "constrained" , figsize = (6 , 10 )
179
- )
175
+ mpl .rcParams ["date.converter" ] = 'concise'
176
+ fig , (ax1 , ax2 , ax3 ) = plt .subplots (3 , 1 , figsize = (8 , 12 ), constrained_layout = True )
180
177
181
- x = np .array ([datetime .datetime (2023 , 9 , n ) for n in range (1 , N )])
182
- ax1 .hist (x , range (1 , N ))
183
- ax2 .hist (range (1 , N ), x )
184
- ax3 .hist (x , x )
178
+ start_date = datetime .datetime (2023 , 10 , 1 )
179
+ time_delta = datetime .timedelta (days = 1 )
180
+
181
+ values1 = np .random .randint (1 , 10 , 30 )
182
+ values2 = np .random .randint (1 , 10 , 30 )
183
+ values3 = np .random .randint (1 , 10 , 30 )
184
+
185
+ ax1 .hist ([start_date + i * time_delta for i in range (30 )],bins = 10 ,weights = values1 )
186
+ ax2 .hist ([start_date + i * time_delta for i in range (30 )],bins = 10 ,weights = values2 )
187
+ ax3 .hist ([start_date + i * time_delta for i in range (30 )],bins = 10 ,weights = values3 )
185
188
186
189
@pytest .mark .xfail (reason = "Test for hist2d not written yet" )
187
190
@mpl .style .context ("default" )
0 commit comments