Skip to content

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

Closed
@davefol

Description

@davefol

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions