-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Color scale midpoint #3509
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
Comments
It may be useful if in addition to |
@archmoj I think this is orthogonal to this particular feature. Right now we handle linear interpolation, and auto-computation of bounds, and this proposal is a small refinement on this. We could/should also handle log colorscales with a separate boolean flag, but I'm not sure what the value-added would be of doing something substantially more generic... do you have any specific examples in mind? |
Totally agree. |
Interesting idea. I remember at some point thinking about turning Moreover, perhaps we could add |
Certainly I think that the most common value for |
Right now to use a diverging color scale, the user has to do some math outside of plotly.js to ensure that the midpoint is at an appropriate value in data-space. This math is actually almost impossible to do in the case of
histogram2d
as the data values are computed within plotly.js... I propose a new attributecmid
(orzmid
as appropriate) which would make this easier.If
mid
is provided and neithermin
normax
then after the existing automatic computation, whichever of those two is closest to the midpoint will be pushed away by an appropriate amount. If eithermin
ormax
is provided but not both, then the unspecified one will be set at a distance frommid
equal to the distance of the specified one. If bothmin
andmax
are provided, this setting does nothing.Feedback before I start implementing?
The text was updated successfully, but these errors were encountered: