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
Jklymak colormap norm examp #4499
Conversation
Example with colormap normalizations
Create colormap_normalizations.py
Can you run this through a pep8 checker? The 2.7 test is a transient failure, but the style needs to be cleaned up. |
And this might be better as a |
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/ |
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. |
OK, I just uploaded |
give a color at the center of the colormap *RdBu_r* (white in this | ||
case). | ||
|
||
Normalizations are defined as part of :func:`matplotlib.colors` |
There was a problem hiding this comment.
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."
The PR is here: And the baseline image for my tests is here: |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually -> by default
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Sorry for mirco managing copy editing! I blame by graduate advisor. |
*my :) |
Great. Thanks for going through it! |
DOC: normalization example + explanation
Added an examples/colors/colormap_normalizations.py set of examples to demonstrate how normalizations work.