Skip to content
Merged
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
six and future imports
  • Loading branch information
fariza committed Feb 12, 2014
commit e29262faec517f31adc06f0831c6c91d707701cc
10 changes: 8 additions & 2 deletions examples/color/named_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
Simple plot example with the named colors and its visual representation.
"""

from __future__ import (absolute_import, division, print_function,
unicode_literals)

import six

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors

colors_ = colors.cnames.items()

colors_ = list(six.iteritems(colors.cnames))

# Add the single letter colors.
for name, rgb in colors.ColorConverter.colors.items():
for name, rgb in six.iteritems(colors.ColorConverter.colors):
hex_ = colors.rgb2hex(rgb)
colors_.append((name, hex_))

Expand Down