How to disable wheel_zoom in Bokeh? - python

Usually I do plotting inside of IPython Notebook with pylab mode.
Whenever I use Bokeh, I like to enable output_notebook() to show my plot inside of the IPython notebook.
Most annoying part is that Bokeh enable wheel_zoom by default which cause unintended zoom in IPython notebook.
I know I can avoid this by passing comma separated tools string what I want to include into bokeh.plotting.figure. but with this solution, I should list up the other tools but wheel_zoom.
Is there any way to exclude wheel_zoom only? or Can I disable wheel_zoom in global setting or something like that?

There is an open PR to improve this, it will be in the the 0.11 release.

Related

How come widgets from ipywidgets is not defined in an html file?

I am using nbinteract to develop an interactive web page from a Jupyter notebook. I finally got to the end and published the first version of it but it does not appear the python libraries loaded properly (see image below). This appears to be the problem even in the original nbinteract tutorial. Any ideas on what might be the problem here?
Thank you
It’s possible to export a notebook including widgets to html using nbconvert (https://github.com/jupyter/nbconvert ). You need to make sure to save the notebook using the classic Jupyter Notebook (not JupyterLab) with the “Widgets -> Save Notebook Widget State” menu option.
Unfortunately, it’s not possible to preserve the behavior of the callback functions this way because these functions are defined using Python, and there’s no Python kernel available in the standalone HTML file.
To host interactive figures outside of the notebook , writing a Dash app is always good (https://dash.plot.ly/ ). or If you want to stay in notebook/widget field you could use https://github.com/QuantStack/voila.

Is there a way to open graphs in a new window in VSCode?

I'm graphing some stuff with matplotlib and I need to be able to zoom in on the graph. But VSCode just renders it in its Python Interactive window that I can't do anything with. Is there a way to open graphs in a their own window that allows for scaling and things?
I'm a developer on this extension. We don't currently support popping out graphs. If you want to vote up the issue, we have an issue filed for this support here:
https://github.com/Microsoft/vscode-python/issues/4976
Until this support is added there is a bit of a work around. You can manually use the %matplotlib ipython magic to update to non-inline rendering. Then when you show plots they will be shown in a popup window. Like so:
I can't tell you exactly what command to use as it might vary based on what you have installed in your environment. But %matplotlib auto or %matplotlib qt would be good places to try starting with.

Is there a docstring autocompletion tool for jupyter notebook?

I am looking for a tool/extension that helps you writing python docstrings in jupyter notebook.
I normally use VS code where you have the autodocstring extension that automatically generates templates (e.g. the sphinx or numpy template) for docstrings. Is there an equivalent to this in jupyter notebook?
I have been looking online for a long time now, but have trouble finding it.
run this in a Notebook cell:
%config IPCompleter.greedy=True
Then press tab where you want to do autocomplete.
(Extracted from Reddit post)
To make use of auto complete without the use of tab or shift+tab follow this.
However, I do not think there is an autodocstring extension for jupyter notebook like the one on VS Code you mentioned.

Bokeh/Jupyter Notebook: Charts don't render when downloaded as HTML

My general practice when sharing Jupyter notebooks has been to download them as HTML and hide the code blocks - this works well because it preserves the interactive aspects of the Bokeh charts.
After I recently updated Bokeh, none of the charts I am creating are visible when I download a Jupyter notebook as HTML. I am running Bokeh 0.12.1, Python 3.5, and iPython 5.1.0. Any solutions to this issue?
Update: regressing to Bokeh 0.11.1 and iPython 5.0.0 resolves this issue, and also resolves other ongoing issues around needing to run output_notebook() multiple times.
In order for Bokeh to display anything at all, the BokehJS client library must be loaded. BokehsJS is loaded by the JavaScript code that is executed in the notebook output cell for output_notebook. If you hide the cell containing output_notebook is hidden, the code to load BokehJS is never run, BokehJS is not loaded, and no Bokeh plots will display.
Long story short: you can't hide the cell that calls output_notebook
See this issue for further discussion, as well as a possible alternative to hiding using "notes" cells (it's mentioned there but I don't know anything more about it)

Spyder won't plot figures inline

I have somehow messed up my Spyder configuration and the plots are no longer shown inline (in the IPython console). I followed the steps, described here:
Spyder Plot Inline
But I don't want to reset my configuration in order to get it work. Is there another way? I tried around a lot but can't figure it out.
Ok, this was a simple mistake. I didn't actually run the code in the IPython console but in the normal Python console.

Categories