Black Lives Matter. Please consider donating to Black Girls Code today.

Weird text/annotation in graph

Hi, I’m using the following code to create a plot:

def create_time_series(df):
    return {
        'data': [go.Scatter(
        'layout': {
            'title': '',
            'height': 300,
            'margin': {'l': 100, 'b': 30, 'r': 10, 't': 50},
            'annotations': [{
                'x': 0, 'y': 0.85, 'xanchor': 'left', 'yanchor': 'bottom',
                'xref': 'paper', 'yref': 'paper', 'showarrow': False,
                'align': 'left', 'bgcolor': 'rgba(255, 255, 255, 0.5)'
            'yaxis': {'type': 'linear', 'title': ''},
            'xaxis': {'showgrid': False, 'tickformat': '%Y-%m-%d', 'title': ''}

For some reason it creates a weird text/annotation and I don’t understand why:

Does anyone have any idea why it occurs?


It’s because you did not give the text property of your Annotation example. If you add 'text':'hello' inside the definition of your annotation you will see the text ‘hello’. Please refer to for more details about annotations.