-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix colorbar orientation to always be min->max #27
Conversation
First color left/bottom, last color right/top
Oh I also added pre-commit.ci to this repository. We were already using pre-commit-config in the project, but I forgot to enable the repository on pre-commit.ci. |
Ok I've updated the original description with example images. These are using the "rdbu" colormap so the first color is red, the last color is blue. |
Pull Request Test Coverage Report for Build 4055840102
💛 - Coveralls |
Pull Request Test Coverage Report for Build 4185617677
💛 - Coveralls |
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.
LGTM, Just a suggestion to use linspace instead of arange
A user of one of my projects noticed that the colors for vertical colorbars (scales) had the colors flipped from what they should be. As far as I can tell this has always been like this. Additionally, the colormap was always assumed to have increasing values, but in recent versions of trollimage it is possible to have values in reverse order (flipped values versus flipped colors). This produces colorbars that don't follow what I think most people would expect which is for the colorbar to go from the minimum value to the maximum value. In the horizontal orientation this means minimum value on the left, maximum on the right. For vertical orientation this means minimum value on the bottom, maximum on the top. This PR fixes all of this.