Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plotting axes help
#11
You need to respond to changes in sliders. For example
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.
Reply
#12
Thanks!! I'll have to do a bit more study to get the hang of it. New material for me.

Your help has been appreciated!!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Defining x and y axes in Spectrogram Function amy5678 3 2,303 Nov-29-2020, 01:42 PM
Last Post: jefsummers
  How do I set the figure title and axes labels font size in Matplotlib? anouar2002 1 1,666 Nov-03-2020, 05:31 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020