Skip to content

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

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

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
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
Check for double linestyle definition in plot_format
changed collision detection in lines.py to use ``not linestyle``
  • Loading branch information
lennart0901 committed Oct 19, 2014
commit 14fa552062feac17d0ec34fd0204fd0a8a91b9b7
12 changes: 7 additions & 5 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ def _process_plot_format(fmt):
fmt = fmt.replace(ls, '')
break

# Check for double linestyle definition
if linestyle:
for ls in sorted(mlines.lineStyles, key=len):
if fmt.find(ls) >= 0:
raise ValueError(
'Illegal format string "%s"; two linestyle symbols' % fmt)

chars = [c for c in fmt]

for c in chars:
# if c in mlines.lineStyles:
# if linestyle is not None:
# raise ValueError(
# 'Illegal format string "%s"; two linestyle symbols' % fmt)
# linestyle = c
if c in mlines.lineMarkers:
if marker is not None:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def contains(self, mouseevent):
olderrflags = np.seterr(all='ignore')
try:
# Check for collision
if self._linestyle in ['None', None]:
if not self._linestyle:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has 'None' been completely validated out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should happen at line 958 in set_linestyle:

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

# If no line, return the nearby point(s)
d = (xt - mouseevent.x) ** 2 + (yt - mouseevent.y) ** 2
ind, = np.nonzero(np.less_equal(d, pixels ** 2))
Expand Down