jupyterlab/jupyter-renderers

Plotly extension problem rendering opacity with Scatter3d

nielsgl opened this issue · 0 comments

Hi,

I am experiencing a problem rendering a Scatter3d plot with opacity using the plotly extension in jupyterlab. X_pca is a m x 3 matrix of with 3 pca components.
This is the code that I have to create my plot:

data = []

for name in y.value_counts().keys():
	trace = go.Scatter3d(
		x=X_pca[y==name,0],
		y=X_pca[y==name,1],
		z=X_pca[y==name,2],
		mode='markers',
		name=''.join(map(lambda x: x[0], name.split(' '))),
		marker=dict(size=12, symbol='circle', line=dict(width=1), opacity=1)
	)
	data.append(trace)

layout = go.Layout(
	height=1200,
	width=1200,
)

fig = go.Figure(data=data, layout=layout)

py.iplot(fig)

When I plot the 3d scatter plot without opacity (or opacity=1) it renders fine, but when I set the opacity to anything lower than 1 it doesn't render properly.

You can see the differences here: http://nvgl.it/pxOVpK

I'm using python 3.7.2, with the latest version of jupyterlab and the extension.