Skip to content

Calling plt.scatter with marker="None" on tkinter backend results in Value Error #18390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davefol opened this issue Sep 1, 2020 · 2 comments

Comments

@davefol
Copy link

davefol commented Sep 1, 2020

Bug report

Bug summary
calling scatter with marker="None" results in ValueError.

Code for reproduction

# Paste your code here
#
#
from matplotlib import pyplot as plt
plt.scatter([1], [1], marker="None")

Actual outcome

# If applicable, paste the console output here
#
#
Traceback (most recent call last):
  File "/usr/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/backends/_backend_tk.py", line 242, in resize
    self.draw()
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/backends/backend_tkagg.py", line 9, in draw
    super(FigureCanvasTkAgg, self).draw()
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 407, in draw
    self.figure.draw(self.renderer)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/figure.py", line 1864, in draw
    renderer, self, artists, self.suppressComposite)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 2748, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/collections.py", line 931, in draw
    Collection.draw(self, renderer)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/collections.py", line 385, in draw
    extents = paths[0].get_extents(combined_transform)
  File "path_to_venv/env/lib/python3.7/site-packages/matplotlib/path.py", line 603, in get_extents
    return Bbox([xys.min(axis=0), xys.max(axis=0)])
  File "path_to_venv/env/lib/python3.7/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
Blank plot. Same as if alpha=0 was specified.

Matplotlib version

  • Operating system: Ubuntu 18.04.4 LTS
  • Matplotlib version: 3.3.1
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.7.5
  • Jupyter version (if applicable):
  • Other libraries:
Installed with pip
@dopplershift
Copy link
Contributor

Thanks for the report. This looks like a duplicate of #18254, which is fixed on master and should be fixed in 3.3.2 when that's released. One potential work-around is to roll back to 3.3.0.

@davefol
Copy link
Author

davefol commented Sep 1, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants