Search code examples
pythonplotly

How to remove the small time picker at the bottom of the plotly chart?


how can I remove the bottom area of the chart? Thanks

Example


Solution

  • This code is a copy of the official ploty-website about Candlestick-Plots from the chapter "Candlestick without Rangeslider".

    The important change is this additional line fig.update_layout(xaxis_rangeslider_visible=False):

    import plotly.graph_objects as go
    import pandas as pd
    
    df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
    
    fig = go.Figure(data=[go.Candlestick(x=df['Date'],
                    open=df['AAPL.Open'], high=df['AAPL.High'],
                    low=df['AAPL.Low'], close=df['AAPL.Close'])
                         ])
    
    fig.update_layout(xaxis_rangeslider_visible=False)
    fig.show()