FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add symmetric norm for colormaps · Issue #1806 · matplotlib/matplotlib · GitHub

Repository navigation

Add symmetric norm for colormaps #1806

Closed

Description

There was previously discussion about this but I don't think it ever happened:

Yes, that is exactly what I have in mind. I have a branch started to do this, but it is not ready yet. I am thinking of a kwarg called "vmid" to go with "vmin" and "vmax", the idea being that if it is not None then it expands any specified or autoscaled range in the manner you describe.

#875 (comment)

Just wanted to note here that I have a SymmetricNorm class which auto-scales evenly around a centre point.
It sounds like it could do the trick (and potentially avoid mutually exclusive keywords) and I'd be happy to share.

https://github.com/SciTools/iris/blob/master/lib/iris/palette.py#L164

Activity

  1. phobson commented on Dec 11, 2013

    Member

    I implemented this another way for my own use:
    https://gist.github.com/phobson/7916777

    Personally, I think a vcenter kwarg would be great -- especially if it could propagate to all the methods already using vmin and vmax. That sounds like a pretty big effort, however.

  2. tacaswell commented on Jan 24, 2014

    Member

    @endolith @phobson If either of you want to get a PR together, we can try to get this in 1.4, otherwise, I have tagged this for 1.5

  3. phobson commented on Jan 24, 2014

    Member

    @tacaswell do you think that simply trying to add a vcenter kwarg to colors.Normalize is a good place to start?

    The other question is what would this PR really being trying to accomplish? More specifically, is doing something like this notebook without having to create a totally new colormap the desired end result? http://nbviewer.ipython.org/gist/phobson/7916777

  4. tacaswell commented on Jan 24, 2014

    Member

    I think the simplest thing to add is @efiring suggestion to, if vcenter in passed in push out which ever of vmin and vmax is closer to make the range symmetric (to basically accomplish the upper-right graph from your notebook).

  5. phobson commented on Jan 25, 2014

    Member

    @tacaswell taking a stab at this now.

  6. tacaswell commented on Nov 26, 2014

    Member

    @phobson Did anything come of this?

  7. modified the milestones: , on Nov 26, 2014
  8. phobson commented on Nov 26, 2014

    Member

    I've got an outdated branch on a machine and I could never get all of my edge cases to pass their tests. Basically all I'm trying to do. 

    Knowing what I know now about MPL's internals, I think a separate subclass would be best and could probably take a look at that tonight. The other option is to add the "vcenter" kwarg to the main Norm class. But that seems like a bad idea. Thoughts?

    —
    Sent from Mailbox

    On Wed, Nov 26, 2014 at 2:25 PM, Thomas A Caswell
    notifications@github.com wrote:

    @phobson Did anything come of this?

    Reply to this email directly or view it on GitHub:
    #1806 (comment)

  9. tacaswell commented on Nov 26, 2014

    Member

    On one hand, a new class would be the least disruptive change, on the other hand, I think it would basically be the Normalize class with slightly different __init__.

    On balance, I think a sub-class with arguments like SymNorm(center, half_width) is probably the best way to go because

    • no chance of breaking existing code
    • simple (minimal complicated logic, over-specified arguments)
    • intuitive to find with out having to understand said complicated logic/precedence rules
  10. modified the milestones: , on Nov 26, 2014
  11. phobson commented on Nov 27, 2014

    Member
  12. petehuang commented on Jan 2, 2017

    Contributor

    Tracing related PRs, it seems like the most current related work sits in #7294

  13. modified the milestones: , on Oct 3, 2017
  14. modified the milestones: needs sorting, v3.4.0 on Jul 28, 2020
  15. modified the milestones: v3.4.0, v3.5.0 on Jan 27, 2021
  16. QuLogic commented on Jul 8, 2021

    Member

    Implemented in #17709.

  17. modified the milestones: v3.5.0, v3.4.0 on Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL