Closed
Description
For 3d scatter plots with opacity
< 1, the last trace to be added always shows up on top, regardless of camera position.
import numpy as np
from itertools import product
import plotly.graph_objs as go
import plotly.offline as py
py.init_notebook_mode(connected=True)
# Gen data
n = 10
r = np.arange(n)
a1 = np.zeros((n*n, 3))
a2 = np.zeros((n*n, 3))
for i, (x, y) in enumerate(product(r, r)):
a1[i, :] = (x, y, -1)
a2[i, :] = (x, y, 1)
# Gen traces
traces = list()
for i, a in enumerate((a1, a2)):
trace = go.Scatter3d(
x = a[:, 0],
y = a[:, 1],
z = a[:, 2],
mode="markers",
marker=dict(
opacity=.99
)
)
traces.append(trace)
# Plot
fig = go.Figure(data=traces)
py.iplot(fig)
When trace 1
should be on top:
When trace 0
should be on top:
Metadata
Metadata
Assignees
Labels
No labels