Skip to content
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

Named colors example #2801

Merged
merged 6 commits into from Feb 14, 2014
Merged

Named colors example #2801

merged 6 commits into from Feb 14, 2014

Conversation

fariza
Copy link
Member

@fariza fariza commented Feb 10, 2014

Addressing #2164

@tacaswell tacaswell added this to the v1.4.x milestone Feb 10, 2014
@tonysyu
Copy link
Contributor

tonysyu commented Feb 11, 2014

I completely forgot that I was playing with named colors a long time ago, but I never got a script cleaned up enough for submission as an example. I was pretty happy with the output from this script, but the code is way to messy for an example:

https://gist.github.com/tonysyu/8929788

Maybe you can take some of the ideas in my old script and clean it up. I like the clarity of your example code much better than mine, but I think the output in the linked script is a bit easier to read.

@pelson
Copy link
Member

pelson commented Feb 11, 2014

We might like to put a black border around the colours so that the light ones stand out against a black background.

@fariza
Copy link
Member Author

fariza commented Feb 11, 2014

@tonysyu I like your arrangement.
To keep it simple, I did just a three column arrangement, but without sections.... I'm not convinced yet.
The black border around lines is not constant, depending on the window size, I don't know how to keep it stable.

named_colors

@@ -0,0 +1,50 @@
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cbook
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import

@tonysyu
Copy link
Contributor

tonysyu commented Feb 12, 2014

This looks great: The layout is nice and the code is much easier to read than my original example.

Could you add a docstring for the file describing the purpose of this example? I know it seems self-evident, but it's still helpful for someone browsing examples:

https://github.com/matplotlib/matplotlib/wiki/MEP12#wiki-clean-up-guidelines

@fariza
Copy link
Member Author

fariza commented Feb 12, 2014

Added the docstring, Is this enough for a description or is something more needed?

@tacaswell
Copy link
Member

all the items() calls should probably be six-ified and the future-proofing imports added to the top.

@fariza
Copy link
Member Author

fariza commented Feb 12, 2014

@tacaswell I am not sure what you were refering to with "future-proofing" I added the typical

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

@tacaswell
Copy link
Member

the __future__ imports is what I meant.

@tacaswell
Copy link
Member

👍 from me.

@tonysyu
Copy link
Contributor

tonysyu commented Feb 14, 2014

👍

tacaswell added a commit that referenced this pull request Feb 14, 2014
@tacaswell tacaswell merged commit cb2a52a into matplotlib:master Feb 14, 2014
@fariza fariza deleted the named_colors branch February 17, 2014 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants