Repository navigation
Closed
Labels
Milestone
Description
Bug report
Bug summary
plt.scatter() raises upon drawing when called with marker='' (no errors with 3.3.0).
This change of behavior broke seaborn.
Code for reproduction
import matplotlib.pyplot as plt
plt.scatter([], [], marker='') # fails also with plt.scatter([1,2,3], [1,2,3], marker='')
plt.show()Actual outcome
Traceback (most recent call last):
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py", line 61, in _draw
self.figure.draw(renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/figure.py", line 1863, in draw
mimage._draw_list_compositing_images(
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 2748, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/collections.py", line 931, in draw
Collection.draw(self, renderer)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/collections.py", line 385, in draw
extents = paths[0].get_extents(combined_transform)
File "/Users/maoz/.local/lib/python3.8/site-packages/matplotlib/path.py", line 603, in get_extents
return Bbox([xys.min(axis=0), xys.max(axis=0)])
File "/Users/maoz/miniconda/envs/seaborn_devenv/lib/python3.8/site-packages/numpy/core/_methods.py", line 43, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation minimum which has no identity
Expected outcome
Not to fail.
Matplotlib version
- Operating system: MacOS
- Matplotlib version: 3.3.1
- Matplotlib backend (
print(matplotlib.get_backend())): MacOSX (also reproduces with %inline) - Python version: 3.8.3
- Jupyter version (if applicable):
- Other libraries: numpy 1.19.1
matplotlib installed through pip
Reacted by Daniel Darabos
Activity
jklymak commentedon Aug 14, 2020
Hmmm, maybe a backport went bad, because this works fine on master...
jklymak commentedon Aug 14, 2020
Seems to bisect to 662dc23 which looks right...
jklymak commentedon Aug 14, 2020
... but 662dc23 is exactly the same as master, so something else changed under it....
jklymak commentedon Aug 14, 2020
Its something in
_path.cleanup_paththat didn't get back ported at the same time. @brunobeltran I think this maybe has to do with your path work? This bug is still present, so far as I can tell, on v3.3.x, but its not a bug on master... The only other hint I have is that inpath.py/get_extentsthe value ofself.verticesis empty on v3.3.x, but not empty on master. Either we need to back port whatever 662dc23 was depending on, or we need to revert 662dc23 on the back port branch.QuLogic commentedon Aug 14, 2020
Simple patch, if we don't figure out any more specific cleanup fixes:
QuLogic commentedon Aug 14, 2020
This works in master because we only reverted #17543 for 3.3.x. On master, there are no facecolors because 'none' is an unfilled marker, so the single path optimization is not checked, and then
Path.get_extentsis not called. The bug is still there, it's just not triggered.Don't test on matplotlib 3.3.1 to avoid scatter bug
Don't test on matplotlib 3.3.1 to avoid scatter bug (#2197)
Avoid matplotlib/matplotlib#18254
Add OceanHackWeek2020 tutorial notebook. (#33)
Seaborn original (#1)