def display_to_paper(x, y, layout):
    num_x = x - layout['margin']['l']
    den_x = layout['width'] - (layout['margin']['l'] + layout['margin']['r'])
    num_y = y - layout['margin']['b']
    den_y = layout['height'] - (layout['margin']['b'] + layout['margin']['t'])
    return num_x/den_x, num_y/den_y
Convert mpl display coordinates to plotly paper coordinates.
dataset/ETHPy150Open plotly/plotly.py/plotly/matplotlylib/mpltools.py/display_to_paper