@@ -170,11 +170,52 @@ def test_hexbin(self):
170
170
fig , ax = plt .subplots ()
171
171
ax .hexbin (...)
172
172
173
- @pytest .mark .xfail (reason = "Test for hist not written yet" )
174
173
@mpl .style .context ("default" )
175
174
def test_hist (self ):
176
- fig , ax = plt .subplots ()
177
- ax .hist (...)
175
+ mpl .rcParams ["date.converter" ] = 'concise'
176
+
177
+ start_date = datetime .datetime (2023 , 10 , 1 )
178
+ time_delta = datetime .timedelta (days = 1 )
179
+
180
+ values1 = np .random .randint (1 , 10 , 30 )
181
+ values2 = np .random .randint (1 , 10 , 30 )
182
+ values3 = np .random .randint (1 , 10 , 30 )
183
+
184
+ bin_edges = [start_date + i * time_delta for i in range (31 )]
185
+
186
+ fig , (ax1 , ax2 , ax3 ) = plt .subplots (3 , 1 , constrained_layout = True )
187
+ ax1 .hist (
188
+ [start_date + i * time_delta for i in range (30 )],
189
+ bins = 10 ,
190
+ weights = values1
191
+ )
192
+ ax2 .hist (
193
+ [start_date + i * time_delta for i in range (30 )],
194
+ bins = 10 ,
195
+ weights = values2
196
+ )
197
+ ax3 .hist (
198
+ [start_date + i * time_delta for i in range (30 )],
199
+ bins = 10 ,
200
+ weights = values3
201
+ )
202
+
203
+ fig , (ax4 , ax5 , ax6 ) = plt .subplots (3 , 1 , constrained_layout = True )
204
+ ax4 .hist (
205
+ [start_date + i * time_delta for i in range (30 )],
206
+ bins = bin_edges ,
207
+ weights = values1
208
+ )
209
+ ax5 .hist (
210
+ [start_date + i * time_delta for i in range (30 )],
211
+ bins = bin_edges ,
212
+ weights = values2
213
+ )
214
+ ax6 .hist (
215
+ [start_date + i * time_delta for i in range (30 )],
216
+ bins = bin_edges ,
217
+ weights = values3
218
+ )
178
219
179
220
@pytest .mark .xfail (reason = "Test for hist2d not written yet" )
180
221
@mpl .style .context ("default" )
0 commit comments