Removing the title and the margin of the X and Y axis


How do you remove the titles and the margins of the Y and X axis please (in red) ? I would like to expand my graph on their sides.

The code is :

def test_graph():
    import as px

    x = [1, 3, 2]
    y = [2, 3, 4]

    data_canada ="country == 'Canada'")
    fig =, x='year', y='pop')
          margin=dict(l=0, r=0, t=0, b=0),

    return fig

Thank you.

Hey @BeginnerDash ,

I think you can try :


Have a nice day.

1 Like