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

Skip to content

Commit 451a015

Browse files
committed
support empty dash seq for solid linestyle
svn path=/trunk/matplotlib/; revision=2944
1 parent 39a77ca commit 451a015

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/matplotlib/colors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ def __call__(self, X, alpha=1.0):
577577
interval (0.0, 1.0).
578578
Alpha must be a scalar.
579579
"""
580+
580581
if not self._isinit: self._init()
581582
alpha = min(alpha, 1.0) # alpha must be between 0 and 1
582583
alpha = max(alpha, 0.0)

lib/matplotlib/lines.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,13 @@ def set_ydata(self, y):
528528

529529
def set_dashes(self, seq):
530530
"""
531-
Set the dash sequence, sequence of dashes with on off ink in points
531+
Set the dash sequence, sequence of dashes with on off ink in
532+
points. If seq is empty or if seq = (None, None), the
533+
linestyle will be set to solid.
532534
533535
ACCEPTS: sequence of on/off ink in points
534536
"""
535-
if seq == (None, None):
537+
if seq == (None, None) or len(seq)==0:
536538
self.set_linestyle('-')
537539
else:
538540
self.set_linestyle('--')

0 commit comments

Comments
 (0)