@VivMendes
It seems that you are defining subplots using the obsolete style (used in versions <1.8).
Here is the code using the methods make_subplots, and add_vrect!:
using PlotlyJS
fig= make_subplots(rows=1, cols=2, subplot_titles=["Some noise" "More noise"])
add_trace!(fig, scatter(;x=1:40, y=rand(40), name = "some"), row=1, col=1)
add_trace!(fig, scatter(;x=1:40, y=rand(40), name = "more"), row=1, col=2)
relayout!(fig, hovermode="x")
add_vrect!(fig, 5, 10, fillcolor = "red", opacity = 0.2, line_width = 0; row=1, col=1)
add_vrect!(fig, 20, 26, fillcolor = "blue", opacity = 0.2, line_width = 0; row=1, col=2)
display(fig)
For details search:
?make_subplots
?add_vrect!
LE: to add x-title for each subplot insert in relayout! the two corresponding kwargs and their values:
relayout!(fig, hovermode="x", xaxis_title="first x-title", xaxis2_title="second x-title")
