Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 506ea91

Browse files
committed
Fix incorrect deprecation warning
1 parent 2e921df commit 506ea91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/category.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def convert(value, unit, axis):
5858
is_numlike = all(units.ConversionInterface.is_numlike(v)
5959
and not isinstance(v, (str, bytes))
6060
for v in values)
61-
if is_numlike:
61+
if values.size and is_numlike:
6262
_api.warn_deprecated(
6363
"3.5", message="Support for passing numbers through unit "
6464
"converters is deprecated since %(since)s and support will be "
@@ -230,7 +230,7 @@ def update(self, data):
230230
convertible = self._str_is_convertible(val)
231231
if val not in self._mapping:
232232
self._mapping[val] = next(self._counter)
233-
if convertible:
233+
if data.size and convertible:
234234
_log.info('Using categorical units to plot a list of strings '
235235
'that are all parsable as floats or dates. If these '
236236
'strings should be plotted as numbers, cast to the '

0 commit comments

Comments
 (0)