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

Jklymak colormap norm examp #4499

Merged
merged 13 commits into from Jun 23, 2015
Merged

Jklymak colormap norm examp #4499

merged 13 commits into from Jun 23, 2015

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Jun 7, 2015

Added an examples/colors/colormap_normalizations.py set of examples to demonstrate how normalizations work.

Example with colormap normalizations
@tacaswell
Copy link
Member

Can you run this through a pep8 checker? The 2.7 test is a transient failure, but the style needs to be cleaned up.

@tacaswell
Copy link
Member

And this might be better as a rst file in the rather than as an example.

@tacaswell tacaswell added this to the next point release milestone Jun 7, 2015
@jklymak
Copy link
Member Author

jklymak commented Jun 7, 2015

Cleaned up to PEP8 (in my master branch, confused about how to get into my development branch ;-) ) Happy to make an rst file. I'll put it in doc/users/

@tacaswell
Copy link
Member

Just keep pushing commits to the branch you created this PR off of on github. To move the commits you may need to cherry-pick or just reset your dev branch to where your master branch is and then (maybe force) push to github.

@jklymak
Copy link
Member Author

jklymak commented Jun 9, 2015

OK, I just uploaded doc/users/colormapnorms.rst and the accompanying python scripts into doc/users/plotting/examples/colormap_normalizations_*.py. I wanted to upload before I proofread too heavily and improve the language etc to make sure this format was useful. Suggestions welcome.

give a color at the center of the colormap *RdBu_r* (white in this
case).

Normalizations are defined as part of :func:`matplotlib.colors`
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a sentence or two like "color mapping is a two step process, first the data is mapped to the range [0, 1] and then those values are mapped to RGB. How the mapping to the unit range happens is called the normalization in matplotlib."

@phobson
Copy link
Member

phobson commented Jun 12, 2015

@jklymak
Copy link
Member Author

jklymak commented Jun 12, 2015

I looked this over, made some small changes, and it seems OK to me. I did not make an example for OffsetNorm #3858 but can do so when it is merged to master.

Colormap Normaliztions
================================

Objects that use colormaps usually linearly map the colors in the
Copy link
Member

Choose a reason for hiding this comment

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

usually -> by default

@jklymak
Copy link
Member Author

jklymak commented Jun 14, 2015

OK, the ipython formatting works!

---------------------------------

One of the most common transformations is to plot data by taking its
logarithm (to the base-10). This transofrmation is useful when there
Copy link
Member

Choose a reason for hiding this comment

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

sp 'transformation'

.. plot:: users/plotting/examples/colormap_normalizations_custom.py
:include-source:

Discrete bounds
Copy link
Member

Choose a reason for hiding this comment

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

I would move this above the custom example.

@tacaswell
Copy link
Member

Sorry for mirco managing copy editing! I blame by graduate advisor.

@dopplershift
Copy link
Contributor

*my

:)

@jklymak
Copy link
Member Author

jklymak commented Jun 18, 2015

Great. Thanks for going through it!

tacaswell added a commit that referenced this pull request Jun 23, 2015
DOC: normalization example + explanation
@tacaswell tacaswell merged commit 28ccfa9 into matplotlib:master Jun 23, 2015
@jklymak jklymak deleted the jklymak-colormap-norm-examp branch July 16, 2015 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants