10000 Named colors example by fariza · Pull Request #2801 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Named colors example #2801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 14, 2014
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
0