8000 Use iteritems to iterate over markers · matplotlib/matplotlib@53dfd91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 53dfd91

Browse files
committed
Use iteritems to iterate over markers
1 parent fbf0da9 commit 53dfd91

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/lines_bars_and_markers/marker_reference.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Reference for filled- and unfilled-marker types included with Matplotlib.
33
"""
4+
from six import iteritems
45
import numpy as np
56
import matplotlib.pyplot as plt
67
from matplotlib.lines import Line2D
@@ -31,8 +32,11 @@ def split_list(a_list):
3132

3233
fig, axes = plt.subplots(ncols=2)
3334

35+
print(len(Line2D.markers.items()))
3436
# Filter out filled markers and marker settings that do nothing.
35-
unfilled_markers = [m for m, func in Line2D.markers.items()
37+
# We use iteritems from six to make sure that we get an iterator
38+
# in both python 2 and 3
39+
unfilled_markers = [m for m, func in iteritems(Line2D.markers)
3640
if func != 'nothing' and m not in Line2D.filled_markers]
3741
# Reverse-sort for pretty
3842
unfilled_markers = sorted(unfilled_markers, key=str)[::-1]

0 commit comments

Comments
 (0)
0