Skip to content

How to hide other items in a similar way as hiding a plotted line by clicking the legend at the corner? #499

Answered by highfestiva
PythonAI1234 asked this question in Q&A
Discussion options

You must be logged in to vote

Try this:

candles = fplt.candlestick_ochl(..., ax=ax)

def key_pressed(vb, ev):
    if ev.text() == '1':
        ax.removeItem(candles)
    if ev.text() == '2':
        ax.addItem(candles)
    old_key_pressed(vb, ev)

old_key_pressed, fplt._key_pressed = fplt._key_pressed, key_pressed

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@PythonAI1234
Comment options

Answer selected by PythonAI1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants