Skip to content

Commit 14a501c

Browse files
committed
Use warnings.warn, not logging.warning, in microseconds locator warning.
Otherwise something like ``` from pylab import * from matplotlib import dates; from datetime import * plt.plot([datetime(1990, 1, 1), datetime(1990, 1, 1) + timedelta(microseconds=1500)], [0, 0]) plt.show() ``` results in the same warning being emitted multiple times *for every draw* (e.g. when zooming/panning), which is pretty needless spam.
1 parent 0f54425 commit 14a501c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/dates.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1457,9 +1457,10 @@ def get_locator(self, dmin, dmax):
14571457
else:
14581458
locator = MicrosecondLocator(interval, tz=self.tz)
14591459
if dmin.year > 20 and interval < 1000:
1460-
_log.warning('Plotting microsecond time intervals is not well '
1461-
'supported. Please see the MicrosecondLocator '
1462-
'documentation for details.')
1460+
cbook._warn_external(
1461+
'Plotting microsecond time intervals is not well '
1462+
'supported; please see the MicrosecondLocator '
1463+
'documentation for details.')
14631464

14641465
locator.set_axis(self.axis)
14651466

0 commit comments

Comments
 (0)