File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1201,6 +1201,22 @@ def test_pcolornearest(fig_test, fig_ref):
1201
1201
ax .pcolormesh (x2 , y2 , Z , shading = 'nearest' )
1202
1202
1203
1203
1204
+ @check_figures_equal (extensions = ["png" ])
1205
+ def test_pcolornearestunits (fig_test , fig_ref ):
1206
+ ax = fig_test .subplots ()
1207
+ x = [datetime .datetime .fromtimestamp (x * 3600 ) for x in range (10 )]
1208
+ y = np .arange (0 , 3 )
1209
+ np .random .seed (19680801 )
1210
+ Z = np .random .randn (2 , 9 )
1211
+ ax .pcolormesh (x , y , Z , shading = 'flat' )
1212
+
1213
+ ax = fig_ref .subplots ()
1214
+ # specify the centers
1215
+ x2 = [datetime .datetime .fromtimestamp ((x + 0.5 ) * 3600 ) for x in range (9 )]
1216
+ y2 = y [:- 1 ] + np .diff (y ) / 2
1217
+ ax .pcolormesh (x2 , y2 , Z , shading = 'nearest' )
1218
+
1219
+
1204
1220
@check_figures_equal (extensions = ["png" ])
1205
1221
def test_pcolordropdata (fig_test , fig_ref ):
1206
1222
ax = fig_test .subplots ()
You can’t perform that action at this time.
0 commit comments