Skip to content

Commit 7d28842

Browse files
committed
Switch to draw_idle to try to fix bug on xticks update.
1 parent 3abc310 commit 7d28842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/tests/plotting/test_datetimelike.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,8 @@ def test_format_timedelta_ticks_narrow(self):
12821282
rng = timedelta_range('0', periods=10, freq='ns')
12831283
df = DataFrame(np.random.randn(len(rng), 3), rng)
12841284
ax = df.plot(fontsize=2)
1285-
plt.draw()
12861285
plt.gcf().autofmt_xdate()
1286+
ax.get_figure().canvas.draw_idle()
12871287
labels = ax.get_xticklabels()
12881288
self.assertEqual(len(labels), len(expected_labels))
12891289
for l, l_expected in zip(labels, expected_labels):
@@ -1308,8 +1308,8 @@ def test_format_timedelta_ticks_wide(self):
13081308
rng = timedelta_range('0', periods=10, freq='1 d')
13091309
df = DataFrame(np.random.randn(len(rng), 3), rng)
13101310
ax = df.plot(fontsize=2)
1311-
plt.draw()
13121311
plt.gcf().autofmt_xdate()
1312+
ax.get_figure().canvas.draw_idle()
13131313
labels = ax.get_xticklabels()
13141314
self.assertEqual(len(labels), len(expected_labels))
13151315
for l, l_expected in zip(labels, expected_labels):

0 commit comments

Comments
 (0)