Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 988a567

Browse filesBrowse files
author
Andrew Dawson
committed
BF - prevent a TypeError for lists of vertices
1 parent 260373e commit 988a567
Copy full SHA for 988a567

File tree

Expand file treeCollapse file tree

3 files changed

+15
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+15
-1
lines changed

‎lib/matplotlib/markers.py

Copy file name to clipboardExpand all lines: lib/matplotlib/markers.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def set_marker(self, marker):
164164
self._marker_function = self._set_tuple_marker
165165
elif isinstance(marker, np.ndarray):
166166
self._marker_function = self._set_vertices
167-
elif marker in self.markers:
167+
elif not isinstance(marker, list) and marker in self.markers:
168168
self._marker_function = getattr(
169169
self, '_set_' + self.markers[marker])
170170
elif is_string_like(marker) and is_math_text(marker):
Loading

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,20 @@ def test_transparent_markers():
10061006
ax = fig.add_subplot(111)
10071007
ax.plot(data, 'D', mfc='none', markersize=100)
10081008

1009+
@image_comparison(baseline_images=['vertex_markers'], extensions=['png'],
1010+
remove_text=True)
1011+
def test_vertex_markers():
1012+
data = range(10)
1013+
marker_as_tuple = ((-1, -1), (1, -1), (1, 1), (-1, 1))
1014+
marker_as_list = [(-1, -1), (1, -1), (1, 1), (-1, 1)]
1015+
fig = plt.figure()
1016+
ax = fig.add_subplot(111)
1017+
ax.plot(data, linestyle='', marker=marker_as_tuple, mfc='k')
1018+
ax.plot(data[::-1], linestyle='', marker=marker_as_list, mfc='b')
1019+
ax.set_xlim([-1, 10])
1020+
ax.set_ylim([-1, 10])
1021+
1022+
10091023
if __name__=='__main__':
10101024
import nose
10111025
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.