To initiate subplots:
fig=make_subplots(rows=2, cols=1, subplot_titles=['Plot1', 'Plot2', 'Plot3'])
You then can fill those suplots with:
fig.append_trace(trace=go.Scatter(
x=data[x],
y=data[y]),
#by defining the rows and columns you are defining which of the suplots you are adressing
row=1, col=1)
You can add an image as the background to a graph with:
y_C=1024
x_C=1024
fig.update_layout(
showlegend=False,
images=[
go.layout.Image(source=img,
xref='x',
yref='y',
x=0,
y=y_C,
#using input image sizes as the
#axes lengths for the graph
sizex=x_C,
sizey=y_C,
sizing='stretch',
opacity=1,
layer='below')],
#defining height and width of the graph
height=750,
width=750*aspect_ratio)
You would have to adapt this last piece to add the layout directly to the subplot and not for the whole graph.
I haven’t done this before and the syntax is a bit different in that case, so you would have to fiddle around with that a bit.
Some more examples for images in plots: https://plot.ly/python/images/
Maybe this helps with the layout: Subplots within figure layout dictionary