Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
PiecewiseLinearNorm#5061
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
PiecewiseLinearNorm#5061
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Borrows heavily from@Tillsen's solution found onStackOverflow here:http://goo.gl/RPXMYBUsed with his permission dicussesd on Github here:https://github.com/matplotlib/matplotlib/pull/3858`
This will allow the ticks of colors to be spaced as desired.Also simplified the math per the brilliant@joferkingtonhttp://stackoverflow.com/a/20146989/1552748
couldn't actually run the test suite b/c pythoniesn't installed as a framework.
Need to allow it in __call__ since colorbar can pass a value for clip.
To make it more similar to the other normsAlso remove misleading comment about returning scalars
Since possibly some earlier versions of numpy returned a scalar,wrap the value in atleast_1d before indexing.
np.interp handles the case vmin == vcenter, we have to add a special caseto make the last test case pass
Something that strikes me here, but I don't think for now, how the class inheritance goes
I.e. it should go from the most general at the end of the MRO to most specific at the top... instead we have the most specific, |
@OceanWolf |
@efiring by most specific I mean that as far as I can tell
I don't see what you mean by "additional LOC", as far as I see it we significantly reduce the LOC, i.e. the Normalise class becomes something like: classNormalize(DivergingNorm):def__init__(self,vmin=None,vmax=None):super(Normalize,self).__init__(vmin,None,vmax) |
Btw the is a lot of overlap between transforms and the norms, it would be nice - a properly quite difficult - to combine these. |
@Tillsten Yes, I have plans to do this with my MEP working on refactoring the axes#5029, I plan to merge the colourbar with the other axis code, essentially these Normalisations works as axis transformations, so it makes sense to me to simply the API here. As these extra norms have been pushed back to at least the 2.1 release next April, this gives me time to work on this MEP. We shall see how far I get with this. Help always appreciated, especially as I have MEP 22 and 27 to finish for 2.1 once 1.5 lands. |
See#12419 where I moved this PR (couldn't see force pushing here as viable) |
Working implementation of a
PiecewiseLinearNorm
, including aDivergingNorm
subclass.All the tests from the@dopplershift and@phobson at present pass apart from the tests that have norms that don't monotonically increase (i.e. they stay static) e.g. where vmin=vcenter and/or vcenter=vmax.
Should we allow this or not?