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

Skip to content

Commit 273462d

Browse files
committed
Use iteritems to iterate over markers
1 parent fbf0da9 commit 273462d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/lines_bars_and_markers/marker_reference.py

Lines changed: 4 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
@@ -32,7 +33,9 @@ def split_list(a_list):
3233
fig, axes = plt.subplots(ncols=2)
3334

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

0 commit comments

Comments
 (0)