ipywidgets

Embed widgets with pythreejs: wrong perspective and camera look-at

≯℡__Kan透↙ 提交于 2020-01-14 06:36:26
问题 The bounty expires in 3 days . Answers to this question are eligible for a +50 reputation bounty. Peque wants to draw more attention to this question. I am using pythreejs to visualize some 3D models. When visualizing the models on a Jupyter notebook, everything works as expected. But when trying to embed the widget in an HTML document, I am facing two problems: It seems the camera, on load, is looking at (0, 0, 0), not as expected, and once you interact with the widget, the camera will "jump

Clear widget area of a cell in a Jupyter notebook from within notebook

﹥>﹥吖頭↗ 提交于 2020-01-13 10:17:14
问题 I'm wondering if it's possible to clear the widget area of a cell in a Jupyter notebook from the notebook side (ie within Python). IPython.display.clear_output() only clears the cell's output area not the widget area. Update: this still seems to be a problem in latest Notebook and ipywidgets. Here are two minimal examples illustrating the problem I'm struggling with. The widget output that I'm trying to clear in particular are the data frames rendered by qgrid. In both cases, despite trying

Using Ipython ipywidget to create a variable?

寵の児 提交于 2020-01-12 04:38:29
问题 This seems really simple but I have not been able to find a single example or to solve this myself. How do I use an ipywidget widget to create or return a python variable/object, such as a list or string, that can be used in a following cell? 回答1: There is a good introduction to ipywidgets at http://blog.dominodatalab.com/interactive-dashboards-in-jupyter/ which answers this question. You need two widgets, one for input, and another to bind the value of that input. Here's an example for text

Interactive matplotlib using ipywidgets

戏子无情 提交于 2020-01-11 04:39:08
问题 I want to implement an interactive plot using Matplotlib and ipywidgets in IPython (python3). So, how I can do this efficiently (change smoothly without delay)? And another question is why this code works?! from ipywidgets import * import numpy as np import matplotlib.pyplot as plt %matplotlib inline x = np.linspace(0, 2 * np.pi) def update(w = 1.0): fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot(x, np.sin(w * x)) fig.canvas.draw() interact(update); But, this doesn't work?! from

Have 2 Ipywidgets acting on one matplotlib plot in Jupyter - Python

谁说我不能喝 提交于 2020-01-06 03:11:31
问题 The following code simulates a machine learning, linear regression process. It is meant to allow the user to do the regression manually and visually in a Jupyter notebook to get a better feel for the linear regression process. The first section (x,y) of the function generates a plot to perform the regression on. The next section (a,b) generates the line to play with, for the simulated regression. I want to be able to change the slope slider without the scatter plot being regenerated. Any

Have 2 Ipywidgets acting on one matplotlib plot in Jupyter - Python

会有一股神秘感。 提交于 2020-01-06 03:11:08
问题 The following code simulates a machine learning, linear regression process. It is meant to allow the user to do the regression manually and visually in a Jupyter notebook to get a better feel for the linear regression process. The first section (x,y) of the function generates a plot to perform the regression on. The next section (a,b) generates the line to play with, for the simulated regression. I want to be able to change the slope slider without the scatter plot being regenerated. Any

How to add widgets to container widget in ipython/jupyter

╄→尐↘猪︶ㄣ 提交于 2020-01-05 06:33:49
问题 I am trying to make VBox widget and and add a new row with text when button is clicked. I try the following code import ipywidgets as wg from ipywidgets import Layout from IPython.display import display vb = wg.VBox([wg.Text('1'),wg.Text('2')]) btn = wg.Button(description = 'Add') def on_bttn_clicked(b): vb.children=tuple(list(vb.children).append(wg.Text('3'))) btn.on_click(on_bttn_clicked) display(vb, btn) list(hb.children) But the assignment "hb.children=" does not work... Is there a way to

How to add widgets to container widget in ipython/jupyter

泪湿孤枕 提交于 2020-01-05 06:33:28
问题 I am trying to make VBox widget and and add a new row with text when button is clicked. I try the following code import ipywidgets as wg from ipywidgets import Layout from IPython.display import display vb = wg.VBox([wg.Text('1'),wg.Text('2')]) btn = wg.Button(description = 'Add') def on_bttn_clicked(b): vb.children=tuple(list(vb.children).append(wg.Text('3'))) btn.on_click(on_bttn_clicked) display(vb, btn) list(hb.children) But the assignment "hb.children=" does not work... Is there a way to

How to make one slider/widget update multiple plots in Bokeh/Python/Pywidgets?

谁说胖子不能爱 提交于 2020-01-02 17:07:13
问题 Using Jupyter notebook, how to have one slider interactively update two independent functions in two figures? There is a link to a similar question without answer here. Using Bokeh Javascript Callback slider power example, I tried adding a second set of variables x and y but keep using the same callback. The graphs do not update anymore. Any suggestions? I also was trying to do the same with Pywidget but did not get anywhere. I would prefer using IPywidget if there is a solution there. The

How to make one slider/widget update multiple plots in Bokeh/Python/Pywidgets?

大憨熊 提交于 2020-01-02 17:05:18
问题 Using Jupyter notebook, how to have one slider interactively update two independent functions in two figures? There is a link to a similar question without answer here. Using Bokeh Javascript Callback slider power example, I tried adding a second set of variables x and y but keep using the same callback. The graphs do not update anymore. Any suggestions? I also was trying to do the same with Pywidget but did not get anywhere. I would prefer using IPywidget if there is a solution there. The