Skip to content

Freeze when setting dashed linewidth to a close-to-zero float #14498

Open
@fk3

Description

@fk3

Bug report

Bug summary

When setting the linewidth to a value close to zero (like 1e-15) and having a dashed linestyle in a pyplot, the application freezes.

Code for reproduction

from matplotlib import pyplot as plt

x = [0,1]
y = [0,1]

p = plt.plot(x,y, ls = "--", lw = 0.1, ms = 0.1, marker = "o", alpha = 1.0)

# ok
# plt.setp(p, lw = 1e-3)

# freeze
plt.setp(p, lw = 1e-15)

plt.show()

Actual outcome

The window opens but no plot (not even axis) is shown, instead the window is not responding.

Expected outcome

Primary Expectation: The application should not freeze.
Secondary Expectation: Show either no line at all or as thin as displayable.

Matplotlib version

  • Operating system: Windows 7
  • Matplotlib version: 2.2.4 (same with 3.1.0)
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg (same with Qt5Agg/PySide2)
  • Python version: 3.6.5 32bit

installed with pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions