-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Disable automatic coloring and sizing on Points #748
Conversation
I agree. My worry is backwards compatibility.
As far as I know, our only other default colormap is 'hot'. Anything that shows up well against 'hot' would be good.
Hmm. Actually, I might prefer this. Sizing is definitely problematic but automatically using a colormap doesn't seem so bad. As a result, I might just consider disabling Unfortunately, |
We've only had sizing enabled by default since 1.5 so going back on that shouldn't be too bad.
Yes, we can be consistent.
Yes not sure what to do about that. We could leave |
That would be odd though... |
True, not sure what the best suggestion is. Perhaps setting both to None is most reasonable afterall. |
It depends on how often people would have relied on the default behaviour. That is hard to gauge though. If I could ignore backwards compatibility, I would want |
Should we do that in 1.6? Not sure what to do now to make it consistent. Defining a cmap on Points in both backends will do that at least. |
Hmm, maybe set both to |
I'd prefer not changing the behavior twice. |
Well, once it is set explicitly, that specification will be obeyed. I don't think re-enabling default behaviour after disabling it should cause much trouble... |
Unless you don't want point coloring and in 1.6 it would then enable itself automatically. |
Hmm, if you have extra dimensions in your data, then yes. I suppose you are right, we should decide right now. Maybe we can do this:
|
Sounds reasonable, will have to comb through all the notebooks to make sure their output is unchanged. |
This is all very tricky. It was quite disorienting and confusing when 1.5 enabled colors and sizing, thereby changing existing behavior on most of my own notebooks. On balance, I think I favor turning them both off by default, and making people explicitly map to color or size when they want. That will restore compatibility to pre-1.5 notebooks, leaving only ones written for 1.5 needing any change. Hopefully people who just made such notebooks still remember how to fix them, and even then the only ones that would need to change are those using colors and sizing implicitly. I was about to say that any such change should be in a 1.6 release, but now that I think about it, it's arguably more appropriate for a 1.5.x release, because then it can be considered a bugfix to the 1.5 release, restoring pre 1.5 behavior. |
That's not quite what happened, v1.5 enabled sizing by default because sizing changed and previous
Disabling both wouldn't be a bug fix, but the previous behavior was weird, because sizing was ignored until you set the |
I agree this is tricky which is why I wouldn't rush to merge this. I don't think this PR should be part of the dev2 release, but I do think we need to make a decision before the next official release. |
So the color behavior hasn't changed across the releases? I thought I remembered changes in both color and size, but if it was only size that changed, that's a good argument for making color continue to be enabled. We definitely do need to make bokeh consistent with matplotlib for coloring, though. |
I don't think it has, may be wrong though. The problem is it was set to |
I think disabling both sounds safest, then. Sounds like 1.6, though. |
Are we still doing this (disabling both by default) and should it be in 1.6.2? |
+1 for setting a default colormap in bokeh. %%opts Points [color_index=2 size_index=3 scaling_factor=50]
data = np.random.rand(100,4)
points = hv.Points(data, vdims=['z', 'alpha']) works in bokeh when explicitly specifying a colormap. But this took me a while to figure out... (I thought the bokeh backend is somehow broken here...) %%opts Points [color_index=2 size_index=3 scaling_factor=50] (cmap='jet') |
@redst4r Thanks for the input. This should have priority for 1.7.0, the behavior has been confusing for quite some time. Our conclusion was to disable |
Whether disabling coloring and sizing by default or not, adding a default colormap for Bokeh seems like a good idea. |
i'd be fine with disabling |
I now think |
I just made a tiny commit to trigger a fresh travis build. Hopefully this will allow us to update the test data. |
958dbf3
to
9b6bc11
Compare
9b6bc11
to
14c6b13
Compare
3367bb8
to
011d119
Compare
Going to move forward on this. |
5e12524
to
8e0b179
Compare
This has been a long thread - to summarize, we are setting these indices to I now think it is better to be explicit especially as having a default color index can mask explicit attempts to set colors. |
Correct, I just have to update a few tutorial examples to explicitly set these now and then update the test data for a few plots which didn't have a default colormap defined (and fell back to jet). |
8e0b179
to
2f40d60
Compare
So I just went through all the tutorials and they were already being explicit about setting |
Excellent, thanks! |
@jlstevens Finally ready to merge. |
Great! Glad this is finally done. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is a continuing source of confusion and I'm suggesting we disable the
color_index
andsize_index
on Points by default. Having it magically map your variables to colors or scaling the points is often weird and undesired until you have actually requested it. We should also define a default colormap for Points in both backends so that if you do set a color_index it is actually applied in both cases (matplotlib would just fall back to the default cmap before). I'd be open to enabling thecolor_index
by default but sizing can have very unpredictable behavior and should not just happen automatically.Discussion needed.