8000 Allow both linestyle definition "accents" and dash-patterns as linestyle by lennart0901 · Pull Request #3772 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Allow both linestyle definition "accents" and dash-patterns as linestyle #3772

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

Merged
merged 12 commits into from
May 14, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG : properly handle 'none' as linestyle
  • Loading branch information
tacaswell authored and lennart0901 committed Apr 14, 2015
commit 8b90be769b071016554aaba3b1f850ab60f0e47f
13 changes: 8 additions & 5 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,15 +976,18 @@ def set_linestyle(self, linestyle):
linestyle = '-'
break

if linestyle in [' ', '', 'none']:
linestyle = 'None'

if linestyle not in self._lineStyles:
try:
linestyle = ls_mapper_r[linestyle]
except KeyError:
raise ValueError("You passed in an invalid linestyle, see "
"docs of Line2D.set_linestyle for "
"valid values")
if linestyle in [' ', '']:
linestyle = 'None'
raise ValueError(("You passed in an invalid linestyle, "
"`{}`. See "
"docs of Line2D.set_linestyle for "
"valid values.").format(linestyle))

self._linestyle = linestyle

@docstring.dedent_interpd
Expand Down
0