IPython widgets for the Jupyter Notebook
Questions tagged [ipywidgets]
973 questions
3
votes
2 answers
custom text position on ipywidgets button
I am trying to put a "+" sign on a button that reaches all the edges. This is a minimal example, from a Jupyter notebook, first a style:
%%html
and the button itself:
import…

Jansen
- 33
- 7
3
votes
1 answer
How to get value from ipywidget select widget?
I have been having a hard time finding a straightforward solution for this. If I have a select widget, how do I actually get the value that the user clicks? I have seen 'interact' and 'observe' come up in some answers but I'm still not really…

mattingham
- 31
- 1
- 2
3
votes
1 answer
Live plotting in Jupyter Lab 3 using Matplotlib
I want to dynamically update the plot of a cell. I.e. the plot is initialized at the beginning of the cell, and updated in a (computationally heavy) for-loop, showing how the computation is progressing. In jupyter notebook, this can be done using…

Hyperplane
- 1,422
- 1
- 14
- 28
3
votes
1 answer
Ipywidgets (Vbox) not showing up on Jupyter notebook
I am running into this error
A Jupyter widget could not be displayed because the widget state could not be found. This could happen if the kernel storing the widget is no longer available, or if the widget state was not saved in the notebook. You…

startswithH
- 309
- 4
- 14
3
votes
1 answer
How to put image retrieved from url into an image widget
I found this code and it works fine. The image can be retrieved and displayed.
import IPython
url = 'https://newevolutiondesigns.com/images/freebies/colorful-background-14.jpg'
IPython.display.Image(url, width = 250)
However, I actually want to put…

Iman
- 83
- 1
- 1
- 8
3
votes
1 answer
Python: Get single signal from ipywidgets.observe() rather than 3
Essentially, I am creating a number of Toggle Buttons using ipywidgets. When the button is clicked, I would like to add an element to a list. If the button is unclicked, the element is to be removed. (I have not gotten to the action yet)
For the…
3
votes
1 answer
Using %matplotlib widget in jupyter lab with julia kernel
So it turns out when you want to use interactive plots (i.e. with zooming, moving around, rotating etc.) in jupyter lab with a python kernel, you need to use %matplotlib widget, this at least works for me. Now the question is: How could I use that…

varantir
- 6,624
- 6
- 36
- 57
3
votes
2 answers
ipywidget with matplotlib figure always shows two axes
I am trying to create a ipywidget interface with a matplotlib figure that updates upon changing a slider. It works in principle, but it always creates an extra figure.
Here's the code:
import numpy as np
import matplotlib.pyplot as plt
from…

John Smith
- 1,059
- 1
- 13
- 35
3
votes
1 answer
Enabling Multi-Select in ipython-widgets
I have a development problem. I need to be able to select multiple items at the same time from a drop-down menu in python using ipython-widgets. So far, I have been able to choose an option a single-option widget menu, which upon selection will plot…

Anwaya Rath
- 45
- 1
- 1
- 6
3
votes
2 answers
Successive ipywidgets buttons
I'm trying to make a successive process of buttons clicks using ipywidgets buttons.
Click on button 1 is supposed to clear button 1 and display button 2 etc...
It looks like the introduction of the wait variable make my purge function unreachable,…

Xavier M.
- 33
- 3
3
votes
1 answer
Jupyter ipywidget: use one slider widget in one specifc tab in notebook
I am trying to create ipywidgets tab and I am looking for one particular numeric widget in a tab, currently, I am seeing both the tabs as common, how can I see size1 in tab[out2] specifically. My existing code looks like following
import ipywidgets…

Manu Sharma
- 1,593
- 4
- 25
- 48
3
votes
0 answers
ipywidgets interactive with plotly doesn't produce a plot
I'm using GoogleColab. I'm trying to use interactive widgets with python plotly.
A function for produce a simple plotly just works:
from ipywidgets import interactive
import plotly.express as px
def g(x,y):
fig = px.scatter(x=df[x], y=df[y])
…

yuvfried
- 56
- 3
3
votes
2 answers
Read ipywidgets slider value in infinite loop
I am trying to read a slider value in an infinite loop, but there is no print output. My goal is to control a robot with sliders, and the robot needs a constant stream of information even if the slider value doesn't change, thus the infinite while…

Kai Aeberli
- 1,189
- 8
- 21
3
votes
1 answer
Show last output of ipywidget Output widget
I am using ipywidget's 'Output' widget. As text is sent to it, scrollbars appear as the amount exceeds what can be shown. At that point, only the first lines of text are shown. Instead, as new text is added, I want it to auto-scroll such that the…

Robert Lugg
- 1,090
- 2
- 12
- 40
3
votes
1 answer
add a constraint to ipywidgets.datepicker, only allow value between two dates
I'm using the DatePicker widget from ipywidgets. I was wondering if I could set some constraints for the day the user picks. Would it be possible to limit the user to only pick a day between datetime.date(2020, 2, 10) and datetime.date(2020, 2,…

Jef Vandooren
- 124
- 2
- 16