Hi plotly people,
I try to build a plotly layout template which places a logo in the center of the figure. The following code works great for non-subplot figures but it obviously does not work for sub_plots generated by make_subplots(). In subplots the template only places one big logo in the center of the area due to xref and yref = βpaperβ.
In order to get a separate logo in the center of each subplot I assume I would have to calculate the center position of each subplot?
Any ideas or solutions to this problem?
pio.templates["my_template"] = go.layout.Template(
layout=dict(
plot_bgcolor=plot_bgcolor,
# margin=dict(l=50, r=50, t=50, b=20),
colorway=my_colorpalette,
hovermode='x',
font_size=12,
xaxis={"showline": True,
"showgrid": False,
"linecolor": grid_color,
"mirror": False,
"zeroline": True,
"zerolinecolor": grid_color,
"zerolinewidth": 1,
"ticks": 'inside',
"tickcolor": grid_color},
yaxis={"showline": True,
"showgrid": False,
"linecolor": grid_color,
"mirror": False,
"zeroline": True,
"zerolinecolor": grid_color,
"zerolinewidth": 1,
"ticks": 'inside',
"tickcolor": grid_color},
images=[dict(
source=logo_image_source,
name='logo',
xref="paper", yref="paper",
x=0.5, y=0.5,
sizex=0.35, sizey=0.35,
xanchor="center", yanchor="middle",
layer="below", opacity=0.1
)]
),
data=dict(
scatter=[
go.Scatter(marker=dict(symbol="diamond")),
go.Scatter(marker=dict(symbol="square")),
go.Scatter(marker=dict(symbol="circle")),
go.Scatter(marker=dict(symbol="triangle-up")),
go.Scatter(marker=dict(symbol="triangle-down")),
go.Scatter(marker=dict(symbol="star")),
go.Scatter(marker=dict(symbol="x-thin"))
]
)
)
Cheers Amadeus