0

I need to create interactive chart, on which a line can be slided right/left on x axis while saving new values.

Illustration: I have the right red line in the A position but want to move it to B position (orange line) manually and then save position B to a list. what i need to do with a chart picture

I was looking at ipywidgets like the code below, but, for now, it does not seem to be helpful for my task, does it?:

from ipywidgets import interact, interactive, fixed, interact_manual 
import ipywidgets as widgets

def f(x):
    plt.plot(np.arange(0,10), x*np.arange(0,10))
    plt.ylim(-30,30)
    
interact(f, x=10)

Please advise 🙏🏻

2
  • Maybe try pl.axvline(x) instead of plt.plot(...)? Commented Sep 2, 2021 at 15:27
  • Thanks, but the widget with pl.axvline(x) works not as click on chart but as a slider out of the chart . I will need to adjust a long list of values, so sliders for each value does not suit. Commented Sep 3, 2021 at 5:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.