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

Skip to content

Commit 2f5e70b

Browse files
committed
Allow zero linewidth
1 parent f7db03d commit 2f5e70b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ def set_dashes(self, dash_offset, dash_list):
10321032
"""
10331033
if dash_list is not None:
10341034
dl = np.asarray(dash_list)
1035-
if np.any(dl <= 0.0):
1035+
if np.any(dl < 0.0):
10361036
raise ValueError("All values in the dash list must be positive")
10371037
self._dashes = dash_offset, dash_list
10381038

lib/matplotlib/tests/test_axes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,3 +5113,8 @@ def test_twinx_knows_limits():
51135113
ax2.plot([0, 0.5], [1, 2])
51145114

51155115
assert((xtwin.viewLim.intervalx == ax2.viewLim.intervalx).all())
5116+
5117+
5118+
def test_zero_linewidth():
5119+
# Check that setting a zero linewidth doesn't error
5120+
plt.plot([0, 1], [0, 1], ls='--', lw=0)

0 commit comments

Comments
 (0)