Jan-24-2020, 04:23 PM
You need to respond to changes in sliders. For example
The function is where you react to that change. So, you probably want to move all of your calculations and plotting into a function that you then call from value_changed. You could move the code into value_changed but since you will do this for both sliders it would be better to keep it separate.
def value_changedX(change): xdeg1.value = change.new print (f'Slider 1 value is {xdeg1.value}') def value_changedY(change): xdeg2.value = change.new print(f'Slider 2 value is {xdeg2.value}') xdeg1.observe(value_changedX, 'value') xdeg2.observe(value_changedY, 'value')The call to observe is how you link the slider change to your code.
The function is where you react to that change. So, you probably want to move all of your calculations and plotting into a function that you then call from value_changed. You could move the code into value_changed but since you will do this for both sliders it would be better to keep it separate.