-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Interactively hide or show lines after plot finished by clicking (without re-ploting like plot browser feature in MATLAB) #3715
Comments
Thanks for this request It's a feature we've had requested a lot before and I believe there are a number of open issues that describe the pieces of the puzzle that would make this work. You have described two things that would be implemented separately. The first (checkboxes) is possible now - just not in one line. See: http://cecp.mit.edu/pages/air-pollution.html to see an example and check out the checkboxes widget. http://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html#checkbox-group The second means interacting with a legend. I also agree this is a nice feature - similar to C3JS - but is probably further off being done. Hope this helps. |
@birdsarah Is the code for the checkboxes example available somewhere on the web? Or alternatively, a similar example? I already had the impression that it should be possible to do that, but it isn't obvious to me how - due to missing JS skills. Also see my SO question on the topic. |
@birdsarah @damianavila Thankyou for responding! Adding plot selector as a tool would be nice. fig = figure(tools="pan,wheel_zoom,box_zoom,reset,resize,selector")
fig.add_tools(BoxSelectTool(dimensions=["width"])) Then it might look like blue boxed below image. Thank you for the greate library! |
Yes @bluehope - the code for that whole website is here: https://github.com/mit-jp/cge-tools/tree/master/crem_presentation/site (note the data is not available, so you'll just have to look at the code - the dirty secret is that I use a hidden bokeh text input to pass the data back and forth between my external checkboxes and the bokeh plot - you would not have to do this anymore by using User Defined Models) (I haven't implemented User Defined Models yet so don't have more details on that) |
Thanks for the reply - really looking forward to that feature addition! |
That would be a nice feature. |
See #4868 - this adds a visible property to renderers and some checkbox examples showing how to easily turn lines on and off. This isn't the same as interactive legends, and it's still some work to set up, but it gets us closer. |
Here is a snippet (no bokeh server) that does the toggle of lines. Is there a simpler way ?
|
There is an open PR for this issue to add interactive legends as a built-in feature to Bokeh. It is not yet merged or in a release. |
Reference to the PR that closed this, for more details: #5349 |
Hi. Thanks for this - it's been really helpful. I'm just curious but how would one do this for an arbitrary number of lines? |
I was trying to run your code (in VSCode), but keep getting 'SyntaxError: EOF while scanning triple-quoted string literal' error :( |
It would be great to have a feature to interactively hide or show certain lines after the plot is being finished.
When many lines of data exist (5 or more),
plot once and just by clicking to show or hide, similarly in
plot browser
of MATLAB, feature will be very useful.Example of interactively hide or show cetain lines in MATLAB.
This is one of killing feature in MATLAB. http://mathworks.com/help/matlab/ref/plotbrowser.html ### Example of interactively hide or show certain lines in Plotly
This feature would remove painful manual repeating job like below example.
Plot all
remove data 2,3,5,6 & re-plot to compare between data 1,4
remove data 3,4,5 & re-plot to compare between data 1,2,6. Keep repeating for bunch of datas
keep repeating...
The text was updated successfully, but these errors were encountered: