Hey, I have a plot like this:
Is there any way to hide lines’ parts when they overlap with markers? It doesn’t matter when the symbol is full, but it does matter when it is open
and even more so when it is open-dot
ed.
Code
import plotly.graph_objects as go
x1, y1 = [1, 10, 12], [6, 7, 8]
x2, y2 = [x + 3 for x in x1], [(y + 2) / 1.33 for y in y1]
x3, y3 = [2, 4, 6], [8, 7, 4.5]
xs = [x1, x2, x3]
ys = [y1, y2, y3]
colors = ["blue", "red", "green"]
symbols = ["triangle-up", "circle-open-dot", "square-open"]
names = ["full", "open-dot", "open"]
fig = go.Figure()
for x, y, color, symbol, name in zip(xs, ys, colors, symbols, names):
fig.add_trace(
go.Scatter(
x=x,
y=y,
mode="markers",
marker=dict(color=color, size=12, symbol=symbol),
name=name
),
)
fig.add_trace(
go.Scatter(
x=x,
y=y,
mode="lines",
line=dict(color=color, width=1.5),
opacity=0.5,
showlegend=False
),
)
fig.update_layout(template="simple_white", width=800, height=400)
fig.show()
Any help would be highly appreciated