Colorbar with SymmetricalLogLocator now handles negative values (Pull request issue for #7202)#7211
Colorbar with SymmetricalLogLocator now handles negative values (Pull request issue for #7202)#7211egaudry wants to merge 2 commits into
Conversation
|
@efiring as requested by @tacaswell |
| a_range = get_log_range(t, -vmin + 1) | ||
| else: | ||
| a_range = get_log_range(-vmax, -vmin + 1) | ||
| if vmin<0 and vmax<0: |
There was a problem hiding this comment.
I do not understand this logic
There was a problem hiding this comment.
@tacaswell
get_log_range will return a single decade for values bound by two consecutives 2**x:
for instance, -100<x<-10
hence, i'm artificially adding one decade more bounded to 0.
There was a problem hiding this comment.
but why does this only apply to negative values?
|
Thanks! It looks like there are a white space style issues, can you please clean those up? |
|
I took the liberty to rename the title of the PR to something I can understand without browsing the issue. |
|
|
||
| b = np.array(locator()) | ||
| if isinstance(locator, ticker.LogLocator): | ||
| if isinstance(locator, ticker.LogLocator) or isinstance(locator, ticker.SymmetricalLogLocator): |
There was a problem hiding this comment.
Could be simplified to:
if isinstance(locator, (ticker.LogLocator, ticker.SymmetricalLogLocator)):|
This issue is related to negative values, hence the patch only applies to negative values. |
|
Hi @egaudry |
|
@NelleV |
|
hi @egaudry |
|
@NelleV Hi, I haven't a simple test-case to provide, but you could easily reproduce the issue by displaying value between -20 and -90 for instance (all contained in a single negative decade). Thx |
|
So the bug has nothing to do with the SymmetricalLogLocator? |
|
@NelleV My understanding is that it has to do with the SymmetricalLogLocator as you wouldn't use another locator to display negative values with a logarithmic scale. |
|
I'll finish the job. I am halfway there, though I'd appreciate the code to On Oct 23, 2016 11:36 AM, "egaudry" notifications@github.com wrote:
|
|
@NelleV sorry I cannot help, I haven't a reproducer anymore and no time to write it down. If you do try to display values strictly between 2 negative decades, then you'll be able to reproduce the issue I was referring to. |
Pull request issue for issue #7202.
The attached patch allows to draw ticks/ticklabels in case no decade (or only one) was selected based on vmin/vmax detected values. There is however still an issue in the colorbar height.