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

[BUG/ISSUE] Display of all zeros in colorbar #16

Closed
lizziel opened this issue Aug 15, 2019 · 3 comments
Closed

[BUG/ISSUE] Display of all zeros in colorbar #16

lizziel opened this issue Aug 15, 2019 · 3 comments
Assignees
Labels
category: Bug Something isn't working

Comments

@lizziel
Copy link
Contributor

lizziel commented Aug 15, 2019

We have had two different ways of conveying that all displayed values are zero. One is to show multiple zeroes spanning the entire colorbar.
gcpy_multiple_zeroes
Another is to show a single zero in the middle with the bounds of the colorbar unlabeled (current).
gcpy_single_zero
It would be good to get some feedback on preference. I prefer multiple zeroes since then there is no doubt about the range, but others may disagree.

@yantosca
Copy link
Contributor

For me, seeing a single tickmark at zero immediately tells me that the difference is zero. That is quicker than having to look at the whole colorbar to realize that all of the ticmarks are zero. For what it's worth...

@sdeastham
Copy link
Contributor

How about making it more explicit, and changing the single tickmark to read "No change in domain" or "Zero throughout domain"? It's wordy, but it's completely explicit and should be easy to program. Once you have the colorbar (say cb = plt.colorbar()), I think the following would do it:

cb.set_yticks([0])
cb.ax.set_yticklabels(['Zero throughout domain'])

@yantosca
Copy link
Contributor

I've now added a tickmark with "Zero throughout domain" to commit #aa95a343. We can still change the tick label if need be but this makes it explicit.

gcpy2

For the record, I had to use:

cb.set_ticks([0.5])
cb.set_ticklabels(['Zero throughout domain'])

i..e. not set_yticks and set_yticklabels. Also because the normalized color range is now 0 to 1, we are plotting the tickmark at 0.5 in the center. This also makes the zero color show up as white, which is what we wanted.

@msulprizio msulprizio changed the title Display of all zeros in colorbar [BUG/ISSUE] Display of all zeros in colorbar Sep 4, 2019
@yantosca yantosca self-assigned this Oct 17, 2019
@yantosca yantosca added category: Bug Something isn't working resolved labels Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants