Skip to content

SymLogNorm colorbar incorrect on master #16280

Closed

Description

@greglucas

Bug report

Bug summary

The colormap/tick locations within the colorbar are not being updated properly with a SymLogNorm on master. I think this is different than #16269 because it is actually creating the colorbar, just a wrong one.

Compare the previous correct version:
https://matplotlib.org/3.1.0/gallery/userdemo/colormap_normalizations_symlognorm.html

with a fresh checkout of master:

test

Difference in the colorbar of the top axis.

Activity

  1. jklymak commented on Jan 21, 2020

    @jklymak
    Member

    That example is pretty broken anyways.

    Colorbars changed to behave more like normal axes, though I thought they changed in 3.1. Can you bisect this and see what commit made this change?

    I'm ill-disposed to SymLogNorm, but maybe its an easy fix.

  2. dstansby commented on Jan 21, 2020

    @dstansby
    Member

    @jklymak good job I'm well-disposed 😉 - I'll try to look into this as I think I have the same issue too!

  3. self-assigned this
    on Jan 21, 2020
  4. dstansby commented on Jan 21, 2020

    @dstansby
    Member

    Bisects to dc51a68

  5. jklymak commented on Jan 21, 2020

    @jklymak
    Member

    Hmm, well not surprising. I guess the hand-made axes handling that used to be in colorbar did something special with SymLogNorm. This comes back to the issue that @anntzer has that scales and norms are not terribly different. I suspect the correct fix is for someone to gin up a SymLogScale if it doesn't already exist and get that to work and then let it be applied to colorbars. Or special case SymLogNorm in colorbar, but thats a last resort IMHO.

  6. greglucas commented on Jan 22, 2020

    @greglucas
    ContributorAuthor

    @dstansby, out of curiosity how did you bisect that so fast? When I do a git bisect and rebuild with python -mpip install . it takes quite a while to rebuild mpl each time. Is there an automated way that you've got to make bisecting faster?

  7. jklymak commented on Jan 22, 2020

    @jklymak
    Member

    You don’t need to pip install each time if you don’t need to rebuild any of the c code. (And you’ve used pip install -e)

  8. anntzer commented on Jan 22, 2020

    @anntzer
    Contributor

    Some more tricks (everything here assumes you're in a -e install):

    • Even if you need to rebuild c extensions you can just do python setup.py build_ext --inplace which will just rebuild the extensions and skip the rest.
    • ccache (https://ccache.dev/) really helps too (because if you're bisecting even only once in a while, you'll be compiling the same files again and again).
  9. jklymak commented on Feb 1, 2020

    @jklymak
    Member

    So it seems that SymLogNorm itself is also broken, so perhaps not such a bad thing that its colorbar doesn't work: #16376 But of course we should fix these things ASAP.

  10. tacaswell commented on Feb 3, 2020

    @tacaswell
    Member

    @greglucas Using pip install -e . is one way to make it faster (as you don't have to actually re-install if only the python changes) and the other is to use ccache so that the c-extensions build almost instantly.

  11. greglucas commented on Feb 3, 2020

    @greglucas
    ContributorAuthor

    Thanks for the helpful hints on commands! A quick search through the docs doesn't indicate anything telling me about ccache and the wording is pretty vague around the pip install -e . command. I think this would actually be helpful for other new contributors getting started and bisecting, so I will try and look into adding it somewhere in the docs.

  12. added this to the v3.2.0 milestone on Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions