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

Skip to content

Commit e29262f

Browse files
committed
six and future imports
1 parent 29d8e1e commit e29262f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/color/named_colors.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44
Simple plot example with the named colors and its visual representation.
55
"""
66

7+
from __future__ import (absolute_import, division, print_function,
8+
unicode_literals)
9+
10+
import six
11+
712
import numpy as np
813
import matplotlib.pyplot as plt
914
from matplotlib import colors
1015

11-
colors_ = colors.cnames.items()
16+
17+
colors_ = list(six.iteritems(colors.cnames))
1218

1319
# Add the single letter colors.
14-
for name, rgb in colors.ColorConverter.colors.items():
20+
for name, rgb in six.iteritems(colors.ColorConverter.colors):
1521
hex_ = colors.rgb2hex(rgb)
1622
colors_.append((name, hex_))
1723

0 commit comments

Comments
 (0)