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

SymLogNorm colorbar incorrect on master #16280

Closed
greglucas opened this issue Jan 21, 2020 · 10 comments · Fixed by #16392
Closed

SymLogNorm colorbar incorrect on master #16280

greglucas opened this issue Jan 21, 2020 · 10 comments · Fixed by #16392
Assignees
Milestone

Comments

@greglucas
Copy link
Contributor

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.

@jklymak
Copy link
Member

jklymak commented Jan 21, 2020

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.

@dstansby
Copy link
Member

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

@dstansby
Copy link
Member

Bisects to dc51a68

@jklymak
Copy link
Member

jklymak commented Jan 21, 2020

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.

@greglucas
Copy link
Contributor Author

@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?

@jklymak
Copy link
Member

jklymak commented Jan 22, 2020

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)

@anntzer
Copy link
Contributor

anntzer commented Jan 22, 2020

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).

@jklymak
Copy link
Member

jklymak commented Feb 1, 2020

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.

@tacaswell
Copy link
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.

@greglucas
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants